aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2011-12-21 12:41:13 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2011-12-21 12:41:13 +0100
commit0dd65708997f53a829a9830fc584c99ca2e3e57e (patch)
treeab0a09988787879a91be79dc3a8e6bd482622f7d
parentce199b726735374aca84b2111bb19ec103478ebc (diff)
Add a helpful message on what to do with OAuth login issues.
-rw-r--r--protocols/nogaim.c19
1 files changed, 15 insertions, 4 deletions
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. */