diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2011-12-24 19:09:05 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2011-12-24 19:09:05 +0100 |
commit | 34ded90e19635c7ebf2afd184f36b03abc879bec (patch) | |
tree | 93c748b24caa42f27b33482365bdb66af0fbe1c8 /protocols/jabber/jabber.c | |
parent | 164352ef9d3e8b4b2eea8ec64c3b4590b2388b18 (diff) |
Slight cleanup: Use a constant instead of just "jabber_oauth" everywhere,
and added some safeguards to keep the user from messaging it when we're
not actually doing OAuth setup.
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r-- | protocols/jabber/jabber.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 92256a71..41ce509b 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -89,7 +89,7 @@ static void jabber_init( account_t *acc ) s = set_add( &acc->set, "tls_verify", "true", set_eval_bool, acc ); s->flags |= ACC_SET_OFFLINE_ONLY; - + s = set_add( &acc->set, "user_agent", "BitlBee", NULL, acc ); s = set_add( &acc->set, "xmlconsole", "false", set_eval_bool, acc ); @@ -336,7 +336,8 @@ static int jabber_buddy_msg( struct im_connection *ic, char *who, char *message, if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) return jabber_write( ic, message, strlen( message ) ); - if( g_strcasecmp( who, "jabber_oauth" ) == 0 ) + if( g_strcasecmp( who, JABBER_OAUTH_HANDLE ) == 0 && + !( jd->flags & OPT_LOGGED_IN ) && jd->fd == -1 ) { if( sasl_oauth2_get_refresh_token( ic, message ) ) { |