Changeset 9e8c945 for protocols/twitter
- Timestamp:
- 2012-11-10T12:31:33Z (12 years ago)
- Branches:
- master
- Children:
- 8bd866f
- Parents:
- 24132ec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_lib.c
r24132ec r9e8c945 35 35 #include "misc.h" 36 36 #include "base64.h" 37 #include "xmltree.h"38 37 #include "twitter_lib.h" 39 38 #include "json_util.h" … … 257 256 * Fill a list of ids. 258 257 */ 259 static xt_statustwitter_xt_get_friends_id_list(json_value *node, struct twitter_xml_list *txl)258 static gboolean twitter_xt_get_friends_id_list(json_value *node, struct twitter_xml_list *txl) 260 259 { 261 260 json_value *c; … … 267 266 c = json_o_get(node, "ids"); 268 267 if (!c || c->type != json_array) 269 return XT_ABORT;268 return FALSE; 270 269 271 270 for (i = 0; i < c->u.array.length; i ++) { … … 284 283 txl->next_cursor = -1; 285 284 286 return XT_HANDLED;285 return TRUE; 287 286 } 288 287 … … 334 333 } 335 334 336 static xt_statustwitter_xt_get_users(json_value *node, struct twitter_xml_list *txl);335 static gboolean twitter_xt_get_users(json_value *node, struct twitter_xml_list *txl); 337 336 static void twitter_http_get_users_lookup(struct http_request *req); 338 337 … … 421 420 * - all <user>s from the <users> element. 422 421 */ 423 static xt_statustwitter_xt_get_users(json_value *node, struct twitter_xml_list *txl)422 static gboolean twitter_xt_get_users(json_value *node, struct twitter_xml_list *txl) 424 423 { 425 424 struct twitter_xml_user *txu; … … 430 429 431 430 if (!node || node->type != json_array) 432 return XT_ABORT;431 return FALSE; 433 432 434 433 // The root <users> node should hold the list of users <user> … … 440 439 } 441 440 442 return XT_HANDLED;441 return TRUE; 443 442 } 444 443 … … 457 456 * - the user in a twitter_xml_user struct. 458 457 */ 459 static xt_statustwitter_xt_get_status(const json_value *node, struct twitter_xml_status *txs)458 static gboolean twitter_xt_get_status(const json_value *node, struct twitter_xml_status *txs) 460 459 { 461 460 const json_value *rt = NULL, *entities = NULL; 462 int i;463 461 464 462 if (node->type != json_object) 465 return XT_ABORT; 466 467 for (i = 0; i < node->u.object.length; i ++) { 468 const char *k = node->u.object.values[i].name; 469 const json_value *v = node->u.object.values[i].value; 470 463 return FALSE; 464 465 JSON_O_FOREACH (node, k, v) { 471 466 if (strcmp("text", k) == 0 && v->type == json_string) { 472 467 txs->text = g_memdup(v->u.string.ptr, v->u.string.length + 1); … … 496 491 if (rt) { 497 492 struct twitter_xml_status *rtxs = g_new0(struct twitter_xml_status, 1); 498 if ( twitter_xt_get_status(rt, rtxs) != XT_HANDLED) {493 if (!twitter_xt_get_status(rt, rtxs)) { 499 494 txs_free(rtxs); 500 return XT_HANDLED;495 return TRUE; 501 496 } 502 497 … … 534 529 } 535 530 536 return XT_HANDLED;531 return TRUE; 537 532 } 538 533 … … 543 538 * - the next_cursor. 544 539 */ 545 static xt_statustwitter_xt_get_status_list(struct im_connection *ic, const json_value *node,546 540 static gboolean twitter_xt_get_status_list(struct im_connection *ic, const json_value *node, 541 struct twitter_xml_list *txl) 547 542 { 548 543 struct twitter_xml_status *txs; … … 554 549 555 550 if (node->type != json_array) 556 return XT_ABORT;551 return FALSE; 557 552 558 553 // The root <statuses> node should hold the list of statuses <status> … … 575 570 } 576 571 577 return XT_HANDLED;572 return TRUE; 578 573 } 579 574
Note: See TracChangeset
for help on using the changeset viewer.