aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-10-27 09:06:56 +0100
committerdefault <nobody@localhost>2024-10-27 09:06:56 +0100
commitebd8b6137f7bb48c07f7cf48adc55e0bd27bc35f (patch)
treebf229ba6bfe1e68e0c44d81158a961138b38d9e0 /html.c
parentab72acf5e320fd08f49d3faab7b1bc2605c5eb69 (diff)
Skip all repeated attachments, not only images.
Diffstat (limited to 'html.c')
-rw-r--r--html.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/html.c b/html.c
index a5e3c88..cfa9a80 100644
--- a/html.c
+++ b/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 *name = xs_dict_get(a, "name");
- 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;
+ /* 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) {
xs_html_add(content_attachments,
xs_html_tag("a",
xs_html_attr("href", href),