aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/sasl.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2011-12-24 19:09:05 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2011-12-24 19:09:05 +0100
commit34ded90e19635c7ebf2afd184f36b03abc879bec (patch)
tree93c748b24caa42f27b33482365bdb66af0fbe1c8 /protocols/jabber/sasl.c
parent164352ef9d3e8b4b2eea8ec64c3b4590b2388b18 (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/sasl.c')
-rw-r--r--protocols/jabber/sasl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/jabber/sasl.c b/protocols/jabber/sasl.c
index 2f45eb20..b4eb4eb8 100644
--- a/protocols/jabber/sasl.c
+++ b/protocols/jabber/sasl.c
@@ -461,12 +461,12 @@ void sasl_oauth2_init( struct im_connection *ic )
imcb_log( ic, "Starting OAuth authentication" );
/* Temporary contact, just used to receive the OAuth response. */
- imcb_add_buddy( ic, "jabber_oauth", NULL );
+ imcb_add_buddy( ic, JABBER_OAUTH_HANDLE, NULL );
url = oauth2_url( jd->oauth2_service );
msg = g_strdup_printf( "Open this URL in your browser to authenticate: %s", url );
- imcb_buddy_msg( ic, "jabber_oauth", msg, 0, 0 );
- imcb_buddy_msg( ic, "jabber_oauth", "Respond to this message with the returned "
- "authorization token.", 0, 0 );
+ imcb_buddy_msg( ic, JABBER_OAUTH_HANDLE, msg, 0, 0 );
+ imcb_buddy_msg( ic, JABBER_OAUTH_HANDLE, "Respond to this message with the returned "
+ "authorization token.", 0, 0 );
g_free( msg );
g_free( url );
@@ -476,7 +476,7 @@ static gboolean sasl_oauth2_remove_contact( gpointer data, gint fd, b_input_cond
{
struct im_connection *ic = data;
if( g_slist_find( jabber_connections, ic ) )
- imcb_remove_buddy( ic, "jabber_oauth", NULL );
+ imcb_remove_buddy( ic, JABBER_OAUTH_HANDLE, NULL );
return FALSE;
}