diff options
author | default <nobody@localhost> | 2023-08-14 13:12:16 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-08-14 13:12:16 +0200 |
commit | f09340c352c36eceb8befd2466820a6e60aeb9ba (patch) | |
tree | cc6342507030c614fa92d38ca1b2a2962fd3c38e | |
parent | 1d61530a90b9859e7df336e2a3123138300dff54 (diff) |
If a user 'header' field is defined, use it.
-rw-r--r-- | activitypub.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c index a834fad..c7de818 100644 --- a/activitypub.c +++ b/activitypub.c @@ -955,6 +955,16 @@ xs_dict *msg_actor(snac *snac) if (xs_type(xs_dict_get(snac->config, "bot")) == XSTYPE_TRUE) 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; } |