Changeset f4b0911
- Timestamp:
- 2010-05-01T14:10:32Z (15 years ago)
- Branches:
- master
- Children:
- 3b878a1
- Parents:
- c2ecadc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/oauth.c
rc2ecadc rf4b0911 425 425 return ret ? g_string_free( ret, FALSE ) : NULL; 426 426 } 427 428 char *oauth_to_string( struct oauth_info *oi ) 429 { 430 GSList *params = NULL; 431 char *ret; 432 433 oauth_params_add( ¶ms, "oauth_token", oi->token ); 434 oauth_params_add( ¶ms, "oauth_token_secret", oi->token_secret ); 435 ret = oauth_params_string( params ); 436 oauth_params_free( ¶ms ); 437 438 return ret; 439 } 440 441 struct oauth_info *oauth_from_string( char *in, struct oauth_service *sp ) 442 { 443 struct oauth_info *oi = g_new0( struct oauth_info, 1 ); 444 GSList *params = NULL; 445 446 oauth_params_parse( ¶ms, in ); 447 oi->token = g_strdup( oauth_params_get( ¶ms, "oauth_token" ) ); 448 oi->token_secret = g_strdup( oauth_params_get( ¶ms, "oauth_token_secret" ) ); 449 oauth_params_free( ¶ms ); 450 oi->sp = sp; 451 452 return oi; 453 } -
lib/oauth.h
rc2ecadc rf4b0911 85 85 /* Shouldn't normally be required unless the process is aborted by the user. */ 86 86 void oauth_info_free( struct oauth_info *info ); 87 88 /* Convert to and back from strings, for easier saving. */ 89 char *oauth_to_string( struct oauth_info *oi ); 90 struct oauth_info *oauth_from_string( char *in, struct oauth_service *sp ); -
protocols/twitter/twitter.c
rc2ecadc rf4b0911 124 124 /* IM mods didn't do this so far and it's ugly but I should 125 125 be able to get away with it... */ 126 //g_free( ic->acc->pass );127 //ic->acc->pass = g_strdup( info->access_token);126 g_free( ic->acc->pass ); 127 ic->acc->pass = oauth_to_string( info ); 128 128 129 129 twitter_main_loop_start( ic ); … … 171 171 if( !set_getbool( &acc->set, "oauth" ) ) 172 172 td->pass = g_strdup( acc->pass ); 173 //else if( strstr( acc->pass, "oauth_token=" ) )174 // td->oauth = g_strdup( acc->pass);173 else if( strstr( acc->pass, "oauth_token=" ) ) 174 td->oauth_info = oauth_from_string( acc->pass, &twitter_oauth ); 175 175 td->home_timeline_id = 0; 176 176
Note: See TracChangeset
for help on using the changeset viewer.