mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-28 07:33:37 +00:00
Omit the 'image' field if there are any attachment.
This commit is contained in:
parent
0f8ade8c60
commit
eb6d3d0d0e
2 changed files with 3 additions and 3 deletions
|
@ -202,7 +202,7 @@ xs_list *get_attachments(const xs_dict *msg)
|
||||||
else
|
else
|
||||||
attach = xs_dup(p);
|
attach = xs_dup(p);
|
||||||
|
|
||||||
if (xs_type(attach) == XSTYPE_LIST) {
|
if (xs_type(attach) == XSTYPE_LIST && xs_list_len(attach) == 0) {
|
||||||
/* does the message have an image? */
|
/* does the message have an image? */
|
||||||
const xs_dict *d = xs_dict_get(msg, "image");
|
const xs_dict *d = xs_dict_get(msg, "image");
|
||||||
if (xs_type(d) == XSTYPE_DICT) {
|
if (xs_type(d) == XSTYPE_DICT) {
|
||||||
|
|
4
html.c
4
html.c
|
@ -50,8 +50,6 @@ xs_str *make_url(const char *href, const char *proxy)
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
xs *p = xs_str_cat(xs_dup(proxy), "/proxy/");
|
xs *p = xs_str_cat(xs_dup(proxy), "/proxy/");
|
||||||
url = xs_replace(href, "https:/" "/", p);
|
url = xs_replace(href, "https:/" "/", p);
|
||||||
|
|
||||||
srv_debug(1, xs_fmt("Proxying %s %s", href, url));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
url = xs_dup(href);
|
url = xs_dup(href);
|
||||||
|
@ -3244,6 +3242,8 @@ int html_get_handler(const xs_dict *req, const char *q_path,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snac_debug(&snac, 1, xs_fmt("Proxy for %s %d", url, status));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue