commit eb6d3d0

default  ·  2024-11-07 19:04:02 +0000 UTC
parent 0f8ade8
Omit the 'image' field if there are any attachment.
2 files changed,  +3, -3
M html.c
+1, -1
1@@ -202,7 +202,7 @@ xs_list *get_attachments(const xs_dict *msg)
2         else
3             attach = xs_dup(p);
4 
5-        if (xs_type(attach) == XSTYPE_LIST) {
6+        if (xs_type(attach) == XSTYPE_LIST && xs_list_len(attach) == 0) {
7             /* does the message have an image? */
8             const xs_dict *d = xs_dict_get(msg, "image");
9             if (xs_type(d) == XSTYPE_DICT) {
M html.c
+2, -2
 1@@ -50,8 +50,6 @@ xs_str *make_url(const char *href, const char *proxy)
 2     if (proxy) {
 3         xs *p = xs_str_cat(xs_dup(proxy), "/proxy/");
 4         url = xs_replace(href, "https:/" "/", p);
 5-
 6-        srv_debug(1, xs_fmt("Proxying %s %s", href, url));
 7     }
 8     else
 9         url = xs_dup(href);
10@@ -3244,6 +3242,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
11                     }
12                 }
13             }
14+
15+            snac_debug(&snac, 1, xs_fmt("Proxy for %s %d", url, status));
16         }
17     }
18     else