summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2025-05-23 21:26:35 +0000
committerGravatar Uko Kokņevičs2025-05-23 21:26:35 +0000
commit075f21a24eecb32484cf91c24498ec029a7a9a95 (patch)
treefeeefd8285d953703266eeb8b22c80bfba0cabe5
parentDo not replace :shortnames: with nothing in case of failure (diff)
downloadpenes-snac2-075f21a24eecb32484cf91c24498ec029a7a9a95.tar.gz
penes-snac2-075f21a24eecb32484cf91c24498ec029a7a9a95.tar.xz
penes-snac2-075f21a24eecb32484cf91c24498ec029a7a9a95.zip
Don't remove image attachments from posts that have MRFs adding links to images
-rw-r--r--html.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/html.c b/html.c
index 91a9e43..a1bb6e1 100644
--- a/html.c
+++ b/html.c
@@ -2410,8 +2410,11 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2410 const char *name = xs_dict_get(a, "name"); 2410 const char *name = xs_dict_get(a, "name");
2411 2411
2412 /* if this URL is already in the post content, skip */ 2412 /* if this URL is already in the post content, skip */
2413 if (content && xs_str_in(content, o_href) != -1) 2413 /* TODO: This should check more specifically that content has <img src="\{o_href}"> or some such! Some
2414 continue; 2414 instances also add a link to the image in post content which causes this to remove the image from
2415 attachments. */
2416 /* if (content && xs_str_in(content, o_href) != -1) */
2417 /* continue; */
2415 2418
2416 if (strcmp(type, "image/svg+xml") == 0 && !xs_is_true(xs_dict_get(srv_config, "enable_svg"))) 2419 if (strcmp(type, "image/svg+xml") == 0 && !xs_is_true(xs_dict_get(srv_config, "enable_svg")))
2417 continue; 2420 continue;