From 24132ec9af8b275fb4b94e347c6ccce0017c27d0 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 9 Nov 2012 23:53:45 +0000 Subject: Fixed the last parser (generic handler which just remembers status IDs). xmltree.h include can almost be removed, it's just used for return values now. --- protocols/twitter/twitter_lib.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'protocols/twitter/twitter_lib.c') diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index c72c317b..cfa2cf06 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -969,7 +969,7 @@ static void twitter_http_post(struct http_request *req) { struct im_connection *ic = req->data; struct twitter_data *td; - struct xt_node *parsed, *node; + json_value *parsed, *id; // Check if the connection is still active. if (!g_slist_find(twitter_connections, ic)) @@ -981,9 +981,8 @@ static void twitter_http_post(struct http_request *req) if (!(parsed = twitter_parse_response(ic, req))) return; - if ((node = xt_find_node(parsed, "status")) && - (node = xt_find_node(node->children, "id")) && node->text) - td->last_status_id = g_ascii_strtoull(node->text, NULL, 10); + if ((id = json_o_get(parsed, "id")) && id->type == json_integer) + td->last_status_id = id->u.integer; } /** -- cgit v1.2.3