- Timestamp:
- 2010-04-27T22:42:07Z (15 years ago)
- Branches:
- master
- Children:
- 0bff877
- Parents:
- ee84bdb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
ree84bdb r18dbb20 66 66 } 67 67 68 static voidtwitter_oauth_callback( struct oauth_info *info );68 static gboolean twitter_oauth_callback( struct oauth_info *info ); 69 69 70 70 static void twitter_oauth_start( struct im_connection *ic ) 71 71 { 72 struct twitter_data *td = ic->proto_data; 73 72 74 imcb_log( ic, "Requesting OAuth request token" ); 73 75 74 oauth_request_token( TWITTER_OAUTH_REQUEST_TOKEN, twitter_oauth_callback, ic ); 75 } 76 77 static void twitter_oauth_callback( struct oauth_info *info ) 76 td->oauth_info = oauth_request_token( 77 TWITTER_OAUTH_REQUEST_TOKEN, twitter_oauth_callback, ic ); 78 } 79 80 static gboolean twitter_oauth_callback( struct oauth_info *info ) 78 81 { 79 82 struct im_connection *ic = info->data; 80 struct twitter_data *td = ic->proto_data; 81 83 struct twitter_data *td; 84 85 if( !g_slist_find( twitter_connections, ic ) ) 86 return FALSE; 87 88 td = ic->proto_data; 82 89 if( info->stage == OAUTH_REQUEST_TOKEN ) 83 90 { … … 88 95 imcb_error( ic, "OAuth error: %s", info->http->status_string ); 89 96 imc_logout( ic, TRUE ); 90 return ;97 return FALSE; 91 98 } 92 93 td->oauth_info = info;94 99 95 100 sprintf( name, "twitter_%s", ic->acc->user ); … … 106 111 imcb_error( ic, "OAuth error: %s", info->http->status_string ); 107 112 imc_logout( ic, TRUE ); 108 return ;113 return FALSE; 109 114 } 110 115 … … 118 123 twitter_main_loop_start( ic ); 119 124 } 125 126 return TRUE; 120 127 } 121 128 … … 188 195 if( td ) 189 196 { 197 oauth_info_free( td->oauth_info ); 198 190 199 g_free( td->pass ); 191 200 g_free( td->oauth ); … … 206 215 g_strcasecmp(who + 8, ic->acc->user) == 0) 207 216 { 208 if( set_getbool( &ic->acc->set, "oauth" ) && td->oauth == NULL ) 217 if( set_getbool( &ic->acc->set, "oauth" ) && td->oauth_info ) 218 { 209 219 oauth_access_token( TWITTER_OAUTH_ACCESS_TOKEN, message, td->oauth_info ); 220 td->oauth_info = NULL; 221 } 210 222 else 211 223 twitter_post_status(ic, message);
Note: See TracChangeset
for help on using the changeset viewer.