Changeset eb6df6a for protocols/twitter/twitter.c
- Timestamp:
- 2010-07-11T17:21:21Z (14 years ago)
- Branches:
- master
- Children:
- be999a5
- Parents:
- 3759849 (diff), 00540d4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
r3759849 reb6df6a 40 40 return 0; 41 41 42 // If the user uses multiple private message windows we need to get the43 // users buddies.44 if (g_strcasecmp(set_getstr(&ic->acc->set, "mode"), "many") == 0)45 twitter_get_statuses_friends(ic, -1);46 47 42 // Do stuff.. 48 43 twitter_get_home_timeline(ic, -1); … … 56 51 struct twitter_data *td = ic->proto_data; 57 52 58 imcb_log( ic, " Connecting to Twitter" );53 imcb_log( ic, "Getting initial statuses" ); 59 54 60 55 // Run this once. After this queue the main loop function. … … 66 61 } 67 62 63 static void twitter_oauth_start( struct im_connection *ic ); 64 65 void twitter_login_finish( struct im_connection *ic ) 66 { 67 struct twitter_data *td = ic->proto_data; 68 69 if( set_getbool( &ic->acc->set, "oauth" ) && !td->oauth_info ) 70 twitter_oauth_start( ic ); 71 else if( g_strcasecmp( set_getstr( &ic->acc->set, "mode" ), "one" ) != 0 && 72 !( td->flags & TWITTER_HAVE_FRIENDS ) ) 73 { 74 imcb_log( ic, "Getting contact list" ); 75 twitter_get_statuses_friends( ic, -1 ); 76 } 77 else 78 twitter_main_loop_start( ic ); 79 } 68 80 69 81 static const struct oauth_service twitter_oauth = … … 128 140 ic->acc->pass = oauth_to_string( info ); 129 141 130 twitter_ main_loop_start( ic );142 twitter_login_finish( ic ); 131 143 } 132 144 … … 211 223 imcb_buddy_status( ic, name, OPT_LOGGED_IN, NULL, NULL ); 212 224 213 if( td->oauth_info || !set_getbool( &acc->set, "oauth" ) ) 214 twitter_main_loop_start( ic ); 215 else 216 twitter_oauth_start( ic ); 225 imcb_log( ic, "Connecting" ); 226 227 twitter_login_finish( ic ); 217 228 } 218 229 … … 236 247 { 237 248 oauth_info_free( td->oauth_info ); 249 g_free( td->url_host ); 250 g_free( td->url_path ); 238 251 g_free( td->pass ); 239 252 g_free( td ); … … 256 269 td->oauth_info && td->oauth_info->token == NULL ) 257 270 { 258 if( !oauth_access_token( message, td->oauth_info ) ) 271 char pin[strlen(message)+1], *s; 272 273 strcpy( pin, message ); 274 for( s = pin + sizeof( pin ) - 2; s > pin && isspace( *s ); s -- ) 275 *s = '\0'; 276 for( s = pin; *s && isspace( *s ); s ++ ) {} 277 278 if( !oauth_access_token( s, td->oauth_info ) ) 259 279 { 260 280 imcb_error( ic, "OAuth error: %s", "Failed to send access token request" );
Note: See TracChangeset
for help on using the changeset viewer.