Changeset ed83279


Ignore:
Timestamp:
2015-06-17T23:58:02Z (9 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
15c3a6b
Parents:
114154c
Message:

Update Twitter "url" command change to work with Parson.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_lib.c

    r114154c red83279  
    15821582{
    15831583        struct im_connection *ic = req->data;
    1584         json_value *parsed, *id;
     1584        JSON_Value *parsed;
     1585        uint64_t id;
    15851586        const char *name;
    15861587
     
    15941595        }
    15951596
    1596         /* for the parson branch:
    15971597        name = json_object_dotget_string(json_object(parsed), "user.screen_name");
    15981598        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);
     1599
     1600        if (name && id) {
     1601                twitter_log(ic, "https://twitter.com/%s/status/%" G_GUINT64_FORMAT, name, id);
    16061602        } else {
    16071603                twitter_log(ic, "Error: could not fetch tweet url.");
Note: See TracChangeset for help on using the changeset viewer.