Changeset ba3233c for protocols/twitter
- Timestamp:
- 2010-05-30T10:16:37Z (14 years ago)
- Branches:
- master
- Children:
- 3dc6d86, 704dd38
- Parents:
- 3d93aed (diff), 7d53efb (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
r3d93aed rba3233c 286 286 static void twitter_add_buddy( struct im_connection *ic, char *who, char *group ) 287 287 { 288 twitter_friendships_create_destroy(ic, who, 1); 288 289 } 289 290 290 291 static void twitter_remove_buddy( struct im_connection *ic, char *who, char *group ) 291 292 { 293 twitter_friendships_create_destroy(ic, who, 0); 292 294 } 293 295 -
protocols/twitter/twitter_lib.c
r3d93aed rba3233c 656 656 657 657 /** 658 * Callback after sending a new updateto twitter.659 */ 660 static void twitter_http_post _status(struct http_request *req)658 * Callback to use after sending a post request to twitter. 659 */ 660 static void twitter_http_post(struct http_request *req) 661 661 { 662 662 struct im_connection *ic = req->data; … … 669 669 if (req->status_code != 200) { 670 670 // It didn't go well, output the error and return. 671 imcb_error(ic, " Could not post message: %s", twitter_parse_error(req));671 imcb_error(ic, "HTTP error: %s", twitter_parse_error(req)); 672 672 return; 673 673 } … … 682 682 args[0] = "status"; 683 683 args[1] = msg; 684 twitter_http(ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post _status, ic, 1, args, 2);684 twitter_http(ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1, args, 2); 685 685 // g_free(args[1]); 686 686 } … … 698 698 args[3] = msg; 699 699 // Use the same callback as for twitter_post_status, since it does basically the same. 700 twitter_http(ic, TWITTER_DIRECT_MESSAGES_NEW_URL, twitter_http_post _status, ic, 1, args, 4);700 twitter_http(ic, TWITTER_DIRECT_MESSAGES_NEW_URL, twitter_http_post, ic, 1, args, 4); 701 701 // g_free(args[1]); 702 702 // g_free(args[3]); 703 703 } 704 705 void twitter_friendships_create_destroy(struct im_connection *ic, char *who, int create) 706 { 707 char* args[2]; 708 args[0] = "screen_name"; 709 args[1] = who; 710 twitter_http(ic, create ? TWITTER_FRIENDSHIPS_CREATE_URL : TWITTER_FRIENDSHIPS_DESTROY_URL, twitter_http_post, ic, 1, args, 2); 711 } -
protocols/twitter/twitter_lib.h
r3d93aed rba3233c 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.