Changeset 2abceca for protocols/twitter/twitter_lib.c
- Timestamp:
- 2010-04-06T17:25:51Z (14 years ago)
- Branches:
- master
- Children:
- 0519b0a
- Parents:
- 62d2cfb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_lib.c
r62d2cfb r2abceca 65 65 g_free(txu->name); 66 66 g_free(txu->screen_name); 67 g_free(txu); 67 68 } 68 69 … … 76 77 g_free(txs->text); 77 78 txu_free(txs->user); 79 g_free(txs); 78 80 } 79 81 … … 131 133 { 132 134 // Do something with the cursor. 133 txl->next_cursor = atoi(node->text);135 txl->next_cursor = node->text != NULL ? atoi(node->text) : -1; 134 136 135 137 return XT_HANDLED; … … 153 155 { 154 156 // Add the item to the list. 155 txl->list = g_slist_append (txl->list, g_memdup( node->text, node->text_len + 1 ));157 txl->list = g_slist_append (txl->list, g_memdup( child->text, child->text_len + 1 )); 156 158 } 157 159 else if ( g_strcasecmp( "next_cursor", child->name ) == 0) … … 187 189 188 190 txl = g_new0(struct twitter_xml_list, 1); 189 txl->list = NULL;190 191 191 192 // Parse the data. … … 451 452 if (req->status_code != 200) { 452 453 // It didn't go well, output the error and return. 453 imcb_error(ic, "Could not retrieve home/timeline. HTTP STATUS: %d", req->status_code);454 imcb_error(ic, "Could not retrieve " TWITTER_HOME_TIMELINE_URL ". HTTP STATUS: %d", req->status_code); 454 455 return; 455 456 } … … 488 489 struct xt_parser *parser; 489 490 struct twitter_xml_list *txl; 491 GSList *l = NULL; 492 struct twitter_xml_user *user; 490 493 491 494 // Check if the connection is still active. … … 496 499 if (req->status_code != 200) { 497 500 // It didn't go well, output the error and return. 498 imcb_error(ic, "Could not retrieve home/timeline.HTTP STATUS: %d", req->status_code);501 imcb_error(ic, "Could not retrieve " TWITTER_SHOW_FRIENDS_URL " HTTP STATUS: %d", req->status_code); 499 502 return; 500 503 } … … 511 514 xt_free( parser ); 512 515 513 GSList *l = NULL;514 struct twitter_xml_user *user;515 516 // Add the users as buddies. 516 517 for ( l = txl->list; l ; l = g_slist_next(l) ) … … 559 560 if (req->status_code != 200) { 560 561 // It didn't go well, output the error and return. 561 imcb_error(ic, "Could not post tweed... HTTP STATUS: %d", req->status_code); 562 imcb_error(ic, req->reply_body); 562 imcb_error(ic, "Could not post tweet... HTTP STATUS: %d", req->status_code); 563 563 return; 564 564 }
Note: See TracChangeset
for help on using the changeset viewer.