diff options
| author | 2024-12-19 05:19:04 +0100 | |
|---|---|---|
| committer | 2024-12-19 05:19:04 +0100 | |
| commit | 103dc7d4f2ba729737fd0ca768146247022a4b59 (patch) | |
| tree | 6ee98219847cb4f557e84d456313611c23ec9ff8 /data.c | |
| parent | Searching for URLs brings a post to the user timeline. (diff) | |
| download | penes-snac2-103dc7d4f2ba729737fd0ca768146247022a4b59.tar.gz penes-snac2-103dc7d4f2ba729737fd0ca768146247022a4b59.tar.xz penes-snac2-103dc7d4f2ba729737fd0ca768146247022a4b59.zip | |
In content_search(), also test the 'url' post field (if it exists).
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 9 |
1 files changed, 9 insertions, 0 deletions
| @@ -2750,6 +2750,15 @@ xs_list *content_search(snac *user, const char *regex, | |||
| 2750 | continue; | 2750 | continue; |
| 2751 | } | 2751 | } |
| 2752 | 2752 | ||
| 2753 | /* test for the alternate post id */ | ||
| 2754 | const char *url = xs_dict_get(post, "url"); | ||
| 2755 | if (!xs_is_null(url) && strcmp(url, regex) == 0) { | ||
| 2756 | if (xs_set_add(&seen, md5) == 1) | ||
| 2757 | show--; | ||
| 2758 | |||
| 2759 | continue; | ||
| 2760 | } | ||
| 2761 | |||
| 2753 | xs *c = xs_str_new(NULL); | 2762 | xs *c = xs_str_new(NULL); |
| 2754 | const char *content = xs_dict_get(post, "content"); | 2763 | const char *content = xs_dict_get(post, "content"); |
| 2755 | const char *name = xs_dict_get(post, "name"); | 2764 | const char *name = xs_dict_get(post, "name"); |