Changeset 7b87539 for protocols/twitter/twitter_lib.c
- Timestamp:
- 2010-08-07T19:39:01Z (14 years ago)
- Branches:
- master
- Children:
- 203a2d2
- Parents:
- daae10f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_lib.c
rdaae10f r7b87539 736 736 { 737 737 struct im_connection *ic = req->data; 738 struct twitter_data *td; 738 739 739 740 // Check if the connection is still active. … … 741 742 return; 742 743 744 td = ic->proto_data; 745 td->last_status_id = 0; 746 743 747 // Check if the HTTP request went well. 744 748 if (req->status_code != 200) { … … 746 750 imcb_error(ic, "HTTP error: %s", twitter_parse_error(req)); 747 751 return; 752 } 753 754 if (req->body_size > 0) 755 { 756 struct xt_parser *xp = NULL; 757 struct xt_node *node; 758 759 xp = xt_new(NULL, NULL); 760 xt_feed(xp, req->reply_body, req->body_size); 761 762 if ((node = xt_find_node(xp->root, "status")) && 763 (node = xt_find_node(node->children, "id")) && node->text) 764 td->last_status_id = g_ascii_strtoull( node->text, NULL, 10 ); 765 766 xt_free(xp); 748 767 } 749 768 } … … 785 804 twitter_http(ic, create ? TWITTER_FRIENDSHIPS_CREATE_URL : TWITTER_FRIENDSHIPS_DESTROY_URL, twitter_http_post, ic, 1, args, 2); 786 805 } 806 807 void twitter_status_destroy(struct im_connection *ic, guint64 id) 808 { 809 char *url; 810 url = g_strdup_printf("%s%llu%s", TWITTER_STATUS_DESTROY_URL, (unsigned long long) id, ".xml"); 811 twitter_http(ic, url, twitter_http_post, ic, 1, NULL, 0); 812 g_free(url); 813 }
Note: See TracChangeset
for help on using the changeset viewer.