Changeset eb4ad8d for protocols/twitter


Ignore:
Timestamp:
2015-01-17T20:13:19Z (6 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
e26aa72
Parents:
1065dd4 (diff), 664bac3 (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:

Merging random other fixes/cleanups.

Location:
protocols/twitter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter.c

    r1065dd4 reb4ad8d  
    5151        struct twitter_data *td = ic->proto_data;
    5252
     53        char *last_tweet = set_getstr(&ic->acc->set, "_last_tweet");
     54        if (last_tweet)
     55                td->timeline_id = g_ascii_strtoull(last_tweet, NULL, 0);
     56
    5357        /* Create the room now that we "logged in". */
    5458        if (td->flags & TWITTER_MODE_CHAT)
     
    327331        s = set_add(&acc->set, "strip_newlines", "false", set_eval_bool, acc);
    328332       
     333        s = set_add(&acc->set, "_last_tweet", "0", NULL, acc);
     334        s->flags |= SET_HIDDEN | SET_NOSAVE;
     335
    329336        if (strcmp(acc->prpl->name, "twitter") == 0) {
    330337                s = set_add(&acc->set, "stream", "true", set_eval_bool, acc);
  • protocols/twitter/twitter_lib.c

    r1065dd4 reb4ad8d  
    234234void twitter_get_friends_ids(struct im_connection *ic, gint64 next_cursor)
    235235{
    236         // Primitive, but hey! It works...     
     236        // Primitive, but hey! It works...
    237237        char *args[2];
    238238        args[0] = "cursor";
    239         args[1] = g_strdup_printf("%lld", (long long) next_cursor);
     239        args[1] = g_strdup_printf("%" G_GINT64_FORMAT, next_cursor);
    240240        twitter_http(ic, TWITTER_FRIENDS_IDS_URL, twitter_http_get_friends_ids, ic, 0, args, 2);
    241241
     
    721721{
    722722        struct twitter_data *td = ic->proto_data;
     723        char *last_id_str;
    723724       
    724725        if (status->user == NULL || status->text == NULL)
     
    738739        // we won't pick up the updates already in the list.
    739740        td->timeline_id = MAX(td->timeline_id, status->rt_id);
     741
     742        last_id_str = g_strdup_printf("%" G_GUINT64_FORMAT, td->timeline_id);
     743        set_setstr(&ic->acc->set, "last_tweet", last_id_str);
     744        g_free(last_id_str);
    740745}
    741746
     
    9971002        char *args[6];
    9981003        args[0] = "cursor";
    999         args[1] = g_strdup_printf("%lld", (long long) next_cursor);
     1004        args[1] = g_strdup_printf("%" G_GINT64_FORMAT, next_cursor);
    10001005        args[2] = "include_entities";
    10011006        args[3] = "true";
    10021007        if (td->timeline_id) {
    10031008                args[4] = "since_id";
    1004                 args[5] = g_strdup_printf("%llu", (long long unsigned int) td->timeline_id);
     1009                args[5] = g_strdup_printf("%" G_GUINT64_FORMAT, td->timeline_id);
    10051010        }
    10061011
     
    10331038        char *args[6];
    10341039        args[0] = "cursor";
    1035         args[1] = g_strdup_printf("%lld", (long long) next_cursor);
     1040        args[1] = g_strdup_printf("%" G_GINT64_FORMAT, next_cursor);
    10361041        args[2] = "include_entities";
    10371042        args[3] = "true";
    10381043        if (td->timeline_id) {
    10391044                args[4] = "since_id";
    1040                 args[5] = g_strdup_printf("%llu", (long long unsigned int) td->timeline_id);
     1045                args[5] = g_strdup_printf("%" G_GUINT64_FORMAT, td->timeline_id);
    10411046        } else {
    10421047                args[4] = "count";
     
    11671172                "status", msg,
    11681173                "in_reply_to_status_id",
    1169                 g_strdup_printf("%llu", (unsigned long long) in_reply_to)
     1174                g_strdup_printf("%" G_GUINT64_FORMAT, in_reply_to)
    11701175        };
    11711176        twitter_http(ic, TWITTER_STATUS_UPDATE_URL, twitter_http_post, ic, 1,
     
    12011206{
    12021207        char *url;
    1203         url = g_strdup_printf("%s%llu%s", TWITTER_STATUS_DESTROY_URL,
    1204                               (unsigned long long) id, ".json");
     1208        url = g_strdup_printf("%s%" G_GUINT64_FORMAT "%s",
     1209                              TWITTER_STATUS_DESTROY_URL, id, ".json");
    12051210        twitter_http_f(ic, url, twitter_http_post, ic, 1, NULL, 0,
    12061211                       TWITTER_HTTP_USER_ACK);
     
    12111216{
    12121217        char *url;
    1213         url = g_strdup_printf("%s%llu%s", TWITTER_STATUS_RETWEET_URL,
    1214                               (unsigned long long) id, ".json");
     1218        url = g_strdup_printf("%s%" G_GUINT64_FORMAT "%s",
     1219                              TWITTER_STATUS_RETWEET_URL, id, ".json");
    12151220        twitter_http_f(ic, url, twitter_http_post, ic, 1, NULL, 0,
    12161221                       TWITTER_HTTP_USER_ACK);
     
    12411246                NULL,
    12421247        };
    1243         args[1] = g_strdup_printf("%llu", (unsigned long long) id);
     1248        args[1] = g_strdup_printf("%" G_GUINT64_FORMAT, id);
    12441249        twitter_http_f(ic, TWITTER_FAVORITE_CREATE_URL, twitter_http_post,
    12451250                       ic, 1, args, 2, TWITTER_HTTP_USER_ACK);
Note: See TracChangeset for help on using the changeset viewer.