From 4cb21b79b3ade188b628dfc877cfa5fd6f8d5d03 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 13 Jan 2013 11:11:26 +0000 Subject: Don't set up the account_on_timeout() timer if *_login() called imcb_connected() immediately. It's an unusual thing to do since normally there's a bunch of I/O that needs to happen first, but some plugins would like to do this. --- protocols/account.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'protocols/account.c') diff --git a/protocols/account.c b/protocols/account.c index 0eb16b59..1a80df25 100644 --- a/protocols/account.c +++ b/protocols/account.c @@ -349,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 ); } @@ -368,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; } -- cgit v1.2.3