Ignore:
Timestamp:
2016-11-27T13:01:33Z (8 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
87872c7
Parents:
f8c9347
Message:

Expand each (media) URL only once. Twitter likes duplication. #1275.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_lib.c

    rf8c9347 red1f5e8d  
    710710                return;
    711711        if ((quoted = json_o_get(node, "quoted_status")) && quoted->type == json_object) {
    712                 /* New "retweets with comments" feature. Note that this info
    713                  * seems to be included in the streaming API only! Grab the
     712                /* New "retweets with comments" feature. Grab the
    714713                 * full message and try to insert it when we run into the
    715714                 * Tweet entity. */
     
    751750                        char *pos, *new;
    752751
    753                         if (!kort || !disp || !(pos = strstr(*text, kort))) {
     752                        /* Skip if a required field is missing, if the t.co URL is not in fact
     753                           in the Tweet at all, or if the full-ish one *is* in it already
     754                           (dupes appear, especially in streaming API). */
     755                        if (!kort || !disp || !(pos = strstr(*text, kort)) || strstr(*text, disp)) {
    754756                                continue;
    755757                        }
Note: See TracChangeset for help on using the changeset viewer.