mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-12 21:10:22 +03:00
Attached videos are now embedded.
This commit is contained in:
parent
acb3bb90c4
commit
f31dc02715
15
html.c
15
html.c
@ -565,7 +565,10 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
|
|||||||
while (xs_list_iter(&attach, &v)) {
|
while (xs_list_iter(&attach, &v)) {
|
||||||
char *t = xs_dict_get(v, "mediaType");
|
char *t = xs_dict_get(v, "mediaType");
|
||||||
|
|
||||||
if (t && xs_startswith(t, "image/")) {
|
if (xs_is_null(t))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (xs_startswith(t, "image/")) {
|
||||||
char *url = xs_dict_get(v, "url");
|
char *url = xs_dict_get(v, "url");
|
||||||
char *name = xs_dict_get(v, "name");
|
char *name = xs_dict_get(v, "name");
|
||||||
|
|
||||||
@ -573,6 +576,16 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
|
|||||||
xs *s1 = xs_fmt("<p><img src=\"%s\" alt=\"%s\"/></p>\n",
|
xs *s1 = xs_fmt("<p><img src=\"%s\" alt=\"%s\"/></p>\n",
|
||||||
url, xs_is_null(name) ? "" : name);
|
url, xs_is_null(name) ? "" : name);
|
||||||
|
|
||||||
|
s = xs_str_cat(s, s1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (xs_startswith(t, "video/")) {
|
||||||
|
char *url = xs_dict_get(v, "url");
|
||||||
|
|
||||||
|
if (url != NULL) {
|
||||||
|
xs *s1 = xs_fmt("<p><object data=\"%s\"></object></p>\n", url);
|
||||||
|
|
||||||
s = xs_str_cat(s, s1);
|
s = xs_str_cat(s, s1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user