mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
If a user 'header' field is defined, use it.
This commit is contained in:
parent
1d61530a90
commit
f09340c352
1 changed files with 10 additions and 0 deletions
|
@ -955,6 +955,16 @@ xs_dict *msg_actor(snac *snac)
|
||||||
if (xs_type(xs_dict_get(snac->config, "bot")) == XSTYPE_TRUE)
|
if (xs_type(xs_dict_get(snac->config, "bot")) == XSTYPE_TRUE)
|
||||||
msg = xs_dict_set(msg, "type", "Service");
|
msg = xs_dict_set(msg, "type", "Service");
|
||||||
|
|
||||||
|
/* add the header image, if there is one defined */
|
||||||
|
const char *header = xs_dict_get(snac->config, "header");
|
||||||
|
if (!xs_is_null(header)) {
|
||||||
|
xs *d = xs_dict_new();
|
||||||
|
d = xs_dict_append(d, "type", "Image");
|
||||||
|
d = xs_dict_append(d, "mediaType", xs_mime_by_ext(header));
|
||||||
|
d = xs_dict_append(d, "url", header);
|
||||||
|
msg = xs_dict_set(msg, "image", d);
|
||||||
|
}
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue