Changeset 3353b5e for protocols/twitter
- Timestamp:
- 2010-06-30T23:56:46Z (14 years ago)
- Branches:
- master
- Children:
- e1f3f94
- Parents:
- 52a2521 (diff), 8203da9 (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. - Location:
- protocols/twitter
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
r52a2521 r3353b5e 269 269 td->oauth_info && td->oauth_info->token == NULL ) 270 270 { 271 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 ) ) 272 279 { 273 280 imcb_error( ic, "OAuth error: %s", "Failed to send access token request" ); -
protocols/twitter/twitter_lib.c
r52a2521 r3353b5e 42 42 struct twitter_xml_list { 43 43 int type; 44 intnext_cursor;44 gint64 next_cursor; 45 45 GSList *list; 46 46 gpointer data; … … 155 155 * Get the friends ids. 156 156 */ 157 void twitter_get_friends_ids(struct im_connection *ic, intnext_cursor)157 void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor) 158 158 { 159 159 // Primitive, but hey! It works... 160 160 char* args[2]; 161 161 args[0] = "cursor"; 162 args[1] = g_strdup_printf ("% d",next_cursor);162 args[1] = g_strdup_printf ("%lld", (long long) next_cursor); 163 163 twitter_http(ic, TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, args, 2); 164 164 … … 171 171 static xt_status twitter_xt_next_cursor( struct xt_node *node, struct twitter_xml_list *txl ) 172 172 { 173 // Do something with the cursor. 174 txl->next_cursor = node->text != NULL ? atoi(node->text) : -1; 173 char *end = NULL; 174 175 if( node->text ) 176 txl->next_cursor = g_ascii_strtoll( node->text, &end, 10 ); 177 if( end == NULL ) 178 txl->next_cursor = -1; 175 179 176 180 return XT_HANDLED; … … 415 419 * Get the timeline. 416 420 */ 417 void twitter_get_home_timeline(struct im_connection *ic, intnext_cursor)421 void twitter_get_home_timeline(struct im_connection *ic, gint64 next_cursor) 418 422 { 419 423 struct twitter_data *td = ic->proto_data; … … 421 425 char* args[4]; 422 426 args[0] = "cursor"; 423 args[1] = g_strdup_printf ("% d",next_cursor);427 args[1] = g_strdup_printf ("%lld", (long long) next_cursor); 424 428 if (td->home_timeline_id) { 425 429 args[2] = "since_id"; … … 667 671 * Get the friends. 668 672 */ 669 void twitter_get_statuses_friends(struct im_connection *ic, intnext_cursor)673 void twitter_get_statuses_friends(struct im_connection *ic, gint64 next_cursor) 670 674 { 671 675 char* args[2]; 672 676 args[0] = "cursor"; 673 args[1] = g_strdup_printf ("% d",next_cursor);677 args[1] = g_strdup_printf ("%lld", (long long) next_cursor); 674 678 675 679 twitter_http(ic, TWITTER_SHOW_FRIENDS_URL, twitter_http_get_statuses_friends, ic, 0, args, 2); -
protocols/twitter/twitter_lib.h
r52a2521 r3353b5e 76 76 #define TWITTER_BLOCKS_DESTROY_URL "/blocks/destroy/" 77 77 78 void twitter_get_friends_ids(struct im_connection *ic, intnext_cursor);79 void twitter_get_home_timeline(struct im_connection *ic, intnext_cursor);80 void twitter_get_statuses_friends(struct im_connection *ic, intnext_cursor);78 void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor); 79 void twitter_get_home_timeline(struct im_connection *ic, gint64 next_cursor); 80 void twitter_get_statuses_friends(struct im_connection *ic, gint64 next_cursor); 81 81 82 82 void twitter_post_status(struct im_connection *ic, char *msg);
Note: See TracChangeset
for help on using the changeset viewer.