mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-24 22:15:04 +00:00
Skip all repeated attachments, not only images.
This commit is contained in:
parent
ab72acf5e3
commit
ebd8b6137f
1 changed files with 4 additions and 5 deletions
9
html.c
9
html.c
|
@ -1943,12 +1943,11 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
|
||||||
const char *href = xs_dict_get(a, "href");
|
const char *href = xs_dict_get(a, "href");
|
||||||
const char *name = xs_dict_get(a, "name");
|
const char *name = xs_dict_get(a, "name");
|
||||||
|
|
||||||
|
/* if this image is already in the post content, skip */
|
||||||
|
if (xs_str_in(content, href) != -1)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (xs_startswith(type, "image/") || strcmp(type, "Image") == 0) {
|
if (xs_startswith(type, "image/") || strcmp(type, "Image") == 0) {
|
||||||
|
|
||||||
/* if this image is already in the post content, skip */
|
|
||||||
if (xs_str_in(content, href) != -1)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
xs_html_add(content_attachments,
|
xs_html_add(content_attachments,
|
||||||
xs_html_tag("a",
|
xs_html_tag("a",
|
||||||
xs_html_attr("href", href),
|
xs_html_attr("href", href),
|
||||||
|
|
Loading…
Reference in a new issue