commit ebd8b61

default  ·  2024-10-27 08:06:56 +0000 UTC
parent ab72acf
Skip all repeated attachments, not only images.
1 files changed,  +4, -5
M html.c
M html.c
+4, -5
 1@@ -1943,12 +1943,11 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
 2             const char *href = xs_dict_get(a, "href");
 3             const char *name = xs_dict_get(a, "name");
 4 
 5-            if (xs_startswith(type, "image/") || strcmp(type, "Image") == 0) {
 6-
 7-                /* if this image is already in the post content, skip */
 8-                if (xs_str_in(content, href) != -1)
 9-                    continue;
10+            /* if this image is already in the post content, skip */
11+            if (xs_str_in(content, href) != -1)
12+                continue;
13 
14+            if (xs_startswith(type, "image/") || strcmp(type, "Image") == 0) {
15                 xs_html_add(content_attachments,
16                     xs_html_tag("a",
17                         xs_html_attr("href", href),