Changeset 7d53efb
- Timestamp:
- 2010-05-29T12:40:17Z (15 years ago)
- Branches:
- master
- Children:
- ba3233c
- Parents:
- 9997691
- Location:
- protocols/twitter
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
r9997691 r7d53efb 268 268 static void twitter_add_buddy( struct im_connection *ic, char *who, char *group ) 269 269 { 270 twitter_friendships_create_destroy(ic, who, 1); 270 271 } 271 272 272 273 static void twitter_remove_buddy( struct im_connection *ic, char *who, char *group ) 273 274 { 275 twitter_friendships_create_destroy(ic, who, 0); 274 276 } 275 277 -
protocols/twitter/twitter_lib.c
r9997691 r7d53efb 626 626 627 627 /** 628 * Callback after sending a new updateto twitter.629 */ 630 static void twitter_http_post _status(struct http_request *req)628 * Callback to use after sending a post request to twitter. 629 */ 630 static void twitter_http_post(struct http_request *req) 631 631 { 632 632 struct im_connection *ic = req->data; … … 639 639 if (req->status_code != 200) { 640 640 // It didn't go well, output the error and return. 641 imcb_error(ic, " Could not post message... HTTPSTATUS: %d", req->status_code);641 imcb_error(ic, "HTTP Error... STATUS: %d", req->status_code); 642 642 return; 643 643 } … … 654 654 args[0] = "status"; 655 655 args[1] = msg; 656 twitter_http(TWITTER_STATUS_UPDATE_URL, twitter_http_post _status, ic, 1, td->user, td->pass, td->oauth_info, args, 2);656 twitter_http(TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1, td->user, td->pass, td->oauth_info, args, 2); 657 657 // g_free(args[1]); 658 658 } … … 672 672 args[3] = msg; 673 673 // Use the same callback as for twitter_post_status, since it does basically the same. 674 twitter_http(TWITTER_DIRECT_MESSAGES_NEW_URL, twitter_http_post _status, ic, 1, td->user, td->pass, td->oauth_info, args, 4);674 twitter_http(TWITTER_DIRECT_MESSAGES_NEW_URL, twitter_http_post, ic, 1, td->user, td->pass, td->oauth_info, args, 4); 675 675 // g_free(args[1]); 676 676 // g_free(args[3]); 677 677 } 678 679 void twitter_friendships_create_destroy(struct im_connection *ic, char *who, int create) 680 { 681 struct twitter_data *td = ic->proto_data; 682 683 char* args[2]; 684 args[0] = "screen_name"; 685 args[1] = who; 686 twitter_http(create ? TWITTER_FRIENDSHIPS_CREATE_URL : TWITTER_FRIENDSHIPS_DESTROY_URL, twitter_http_post, ic, 1, td->user, td->pass, td->oauth_info, args, 2); 687 } 688 689 690 -
protocols/twitter/twitter_lib.h
r9997691 r7d53efb 82 82 void twitter_post_status(struct im_connection *ic, char *msg); 83 83 void twitter_direct_messages_new(struct im_connection *ic, char *who, char *message); 84 void twitter_friendships_create_destroy(struct im_connection *ic, char *who, int create); 84 85 85 86 #endif //_TWITTER_LIB_H
Note: See TracChangeset
for help on using the changeset viewer.