From 0dd65708997f53a829a9830fc584c99ca2e3e57e Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Wed, 21 Dec 2011 12:41:13 +0100 Subject: Add a helpful message on what to do with OAuth login issues. --- protocols/nogaim.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'protocols/nogaim.c') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index a47e0e84..773e3877 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -326,6 +326,21 @@ void imc_logout( struct im_connection *ic, int allow_reconnect ) imcb_log( ic, "Signing off.." ); + /* TBH I don't remember anymore why I didn't just use ic->acc... */ + for( a = bee->accounts; a; a = a->next ) + if( a->ic == ic ) + break; + + if( a && !allow_reconnect && !( ic->flags & OPT_LOGGED_IN ) && + set_getbool( &a->set, "oauth" ) ) + { + /* If this account supports OAuth, we're not logged in yet and + not allowed to retry, assume there were auth issues. Give a + helpful message on what might be necessary to fix this. */ + imcb_log( ic, "If you're having problems logging in, try re-requesting " + "an OAuth token: account %s set password \"\"", a->tag ); + } + for( l = bee->users; l; ) { bee_user_t *bu = l->data; @@ -347,10 +362,6 @@ void imc_logout( struct im_connection *ic, int allow_reconnect ) query_del_by_conn( (irc_t*) ic->bee->ui_data, ic ); - for( a = bee->accounts; a; a = a->next ) - if( a->ic == ic ) - break; - if( !a ) { /* Uhm... This is very sick. */ -- cgit v1.2.3