Ignore:
Timestamp:
2015-06-17T22:47:26Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
b441614
Parents:
d832164 (diff), 2f99f23 (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.
Message:

Merge remote-tracking branch 'origin/master' into parson

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_lib.c

    rd832164 rb75671d  
    15781578        g_free(args[1]);
    15791579}
     1580
     1581static void twitter_http_status_show_url(struct http_request *req)
     1582{
     1583        struct im_connection *ic = req->data;
     1584        json_value *parsed, *id;
     1585        const char *name;
     1586
     1587        // Check if the connection is still active.
     1588        if (!g_slist_find(twitter_connections, ic)) {
     1589                return;
     1590        }
     1591
     1592        if (!(parsed = twitter_parse_response(ic, req))) {
     1593                return;
     1594        }
     1595
     1596        /* for the parson branch:
     1597        name = json_object_dotget_string(json_object(parsed), "user.screen_name");
     1598        id = json_object_get_integer(json_object(parsed), "id");
     1599        */
     1600
     1601        name = json_o_str(json_o_get(parsed, "user"), "screen_name");
     1602        id = json_o_get(parsed, "id");
     1603
     1604        if (name && id && id->type == json_integer) {
     1605                twitter_log(ic, "https://twitter.com/%s/status/%" G_GUINT64_FORMAT, name, id->u.integer);
     1606        } else {
     1607                twitter_log(ic, "Error: could not fetch tweet url.");
     1608        }
     1609
     1610        json_value_free(parsed);
     1611}
     1612
     1613void twitter_status_show_url(struct im_connection *ic, guint64 id)
     1614{
     1615        char *url = g_strdup_printf("%s%" G_GUINT64_FORMAT "%s", TWITTER_STATUS_SHOW_URL, id, ".json");
     1616        twitter_http(ic, url, twitter_http_status_show_url, ic, 0, NULL, 0);
     1617        g_free(url);
     1618}
Note: See TracChangeset for help on using the changeset viewer.