Ignore:
Timestamp:
2012-12-21T21:50:05Z (8 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
cc6fdf8
Parents:
2dcde94
Message:

For finding since_id, don't use RT original IDs of course. :-/ This fixes
duplicate-tweet issues in non-streaming mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_lib.c

    r2dcde94 r573e274  
    477477                        txs->user = twitter_xt_get_user(v);
    478478                } else if (strcmp("id", k) == 0 && v->type == json_integer) {
    479                         txs->id = v->u.integer;
     479                        txs->rt_id = txs->id = v->u.integer;
    480480                } else if (strcmp("in_reply_to_status_id", k) == 0 && v->type == json_integer) {
    481481                        txs->reply_to = v->u.integer;
     
    492492                        g_free(txs->text);
    493493                        txs->text = g_strdup_printf("RT @%s: %s", rtxs->user->screen_name, rtxs->text);
    494                         txs->rt_id = txs->id;
    495494                        txs->id = rtxs->id;
    496495                        txs_free(rtxs);
     
    647646           remember OUR id instead so undo will work. In other cases, the
    648647           original tweet's id should be remembered for deduplicating. */
    649         if (txs->rt_id && strcmp(txs->user->screen_name, td->user) == 0)
     648        if (strcmp(txs->user->screen_name, td->user) == 0)
    650649                td->log[td->log_id].id = txs->rt_id;
    651650       
     
    746745        // Update the timeline_id to hold the highest id, so that by the next request
    747746        // we won't pick up the updates already in the list.
    748         td->timeline_id = MAX(td->timeline_id, status->id);
     747        td->timeline_id = MAX(td->timeline_id, status->rt_id);
    749748}
    750749
Note: See TracChangeset for help on using the changeset viewer.