aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/account.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/account.c')
-rw-r--r--protocols/account.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/protocols/account.c b/protocols/account.c
index 020a55cd..dec9c3ea 100644
--- a/protocols/account.c
+++ b/protocols/account.c
@@ -1,7 +1,7 @@
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
- * Copyright 2002-2010 Wilmer van der Gaast and others *
+ * Copyright 2002-2013 Wilmer van der Gaast and others *
\********************************************************************/
/* Account management functions */
@@ -153,18 +153,14 @@ char *set_eval_account( set_t *set, char *value )
}
else if( strcmp( set->key, "password" ) == 0 )
{
- if( value )
- {
- g_free( acc->pass );
- acc->pass = g_strdup( value );
- return NULL; /* password shouldn't be visible in plaintext! */
- }
- else
- {
- /* NULL can (should) be stored in the set_t
- variable, but is otherwise not correct. */
- return SET_INVALID;
- }
+ /* set -del should be allowed now, but I don't want to have any
+ NULL pointers to have to deal with. */
+ if( !value )
+ value = "";
+
+ g_free( acc->pass );
+ acc->pass = g_strdup( value );
+ return NULL; /* password shouldn't be visible in plaintext! */
}
else if( strcmp( set->key, "tag" ) == 0 )
{
@@ -353,7 +349,7 @@ void account_on( bee_t *bee, account_t *a )
a->reconnect = 0;
a->prpl->login( a );
- if( a->ic && !( a->ic->flags & OPT_SLOW_LOGIN ) )
+ if( a->ic && !( a->ic->flags & ( OPT_SLOW_LOGIN | OPT_LOGGED_IN ) ) )
a->ic->keepalive = b_timeout_add( 120000, account_on_timeout, a->ic );
}
@@ -372,8 +368,11 @@ static gboolean account_on_timeout( gpointer d, gint fd, b_input_condition cond
{
struct im_connection *ic = d;
- imcb_error( ic, "Connection timeout" );
- imc_logout( ic, TRUE );
+ if( !( ic->flags & ( OPT_SLOW_LOGIN | OPT_LOGGED_IN ) ) )
+ {
+ imcb_error( ic, "Connection timeout" );
+ imc_logout( ic, TRUE );
+ }
return FALSE;
}