- Timestamp:
- 2012-11-25T22:09:41Z (12 years ago)
- Branches:
- master
- Children:
- b235228
- Parents:
- f97b8e9
- Location:
- protocols/twitter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
rf97b8e9 r67f6828 592 592 if (cmd[1] == NULL) 593 593 twitter_status_destroy(ic, td->last_status_id); 594 else if (sscanf(cmd[1], "%" G_G UINT64_FORMAT, &id) == 1) {594 else if (sscanf(cmd[1], "%" G_GINT64_MODIFIER "x", &id) == 1) { 595 595 if (id < TWITTER_LOG_LENGTH && td->log) 596 596 id = td->log[id].id; … … 627 627 posted the given ID if the user wants to do it that way */ 628 628 if (g_str_has_prefix(cmd[1], "#") && 629 sscanf(cmd[1] + 1, "%" G_G UINT64_FORMAT, &id) == 1) {629 sscanf(cmd[1] + 1, "%" G_GINT64_MODIFIER "x", &id) == 1) { 630 630 if (id < TWITTER_LOG_LENGTH && td->log) { 631 631 if (g_slist_find(ic->bee->users, td->log[id].bu)) { … … 655 655 656 656 if (g_str_has_prefix(cmd[1], "#") && 657 sscanf(cmd[1] + 1, "%" G_G UINT64_FORMAT, &id) == 1 &&657 sscanf(cmd[1] + 1, "%" G_GINT64_MODIFIER "x", &id) == 1 && 658 658 (id < TWITTER_LOG_LENGTH) && td->log) { 659 659 bu = td->log[id].bu; … … 665 665 (tud = bu->data) && tud->last_id) { 666 666 id = tud->last_id; 667 } else if (sscanf(cmd[1], "%" G_G UINT64_FORMAT, &id) == 1 &&667 } else if (sscanf(cmd[1], "%" G_GINT64_MODIFIER "x", &id) == 1 && 668 668 (id < TWITTER_LOG_LENGTH) && td->log) { 669 669 bu = td->log[id].bu; -
protocols/twitter/twitter_lib.c
rf97b8e9 r67f6828 67 67 char *text; 68 68 struct twitter_xml_user *user; 69 guint64 id, reply_to; 69 guint64 id, rt_id; /* Usually equal, with RTs id == *original* id */ 70 guint64 reply_to; 70 71 }; 71 72 … … 491 492 g_free(txs->text); 492 493 txs->text = g_strdup_printf("RT @%s: %s", rtxs->user->screen_name, rtxs->text); 494 txs->rt_id = txs->id; 493 495 txs->id = rtxs->id; 494 496 txs_free(rtxs); … … 642 644 td->log[td->log_id].bu = bee_user_by_handle(ic->bee, ic, txs->user->screen_name); 643 645 646 /* This is all getting hairy. :-( If we RT'ed something ourselves, 647 remember OUR id instead so undo will work. In other cases, the 648 original tweet's id should be remembered for deduplicating. */ 649 if (txs->rt_id && strcmp(txs->user->screen_name, td->user) == 0) 650 td->log[td->log_id].id = txs->rt_id; 651 644 652 if (set_getbool(&ic->acc->set, "show_ids")) { 645 653 if (reply_to != -1) … … 1154 1162 return; 1155 1163 1156 if ((id = json_o_get(parsed, "id")) && id->type == json_integer) 1164 if ((id = json_o_get(parsed, "id")) && id->type == json_integer) { 1157 1165 td->last_status_id = id->u.integer; 1166 } 1158 1167 1159 1168 json_value_free(parsed);
Note: See TracChangeset
for help on using the changeset viewer.