snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 564b5b1161adaab9170f52535e2dfa17edc2a18c
parent f1294bd3d44cbe73d89118a8b46c1b9c33de248d
Author: Haijo7 <haijo7@protonmail.com>
Date:   Mon, 12 Jun 2023 10:42:59 +0200

add mastodon profile header to mastodon api

Diffstat:
Mmastoapi.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/mastoapi.c b/mastoapi.c @@ -540,6 +540,16 @@ xs_dict *mastoapi_account(const xs_dict *actor) avatar = xs_fmt("%s/susie.png", srv_baseurl); acct = xs_dict_append(acct, "avatar", avatar); + acct = xs_dict_append(acct, "avatar_static", avatar); + + xs *header = NULL; + xs_dict *hd = xs_dict_get(actor, "image"); + + if (xs_type(hd) == XSTYPE_DICT) + header = xs_dup(xs_dict_get(hd, "url")); + + acct = xs_dict_append(acct, "header", header); + acct = xs_dict_append(acct, "header_static", header); /* emojis */ xs_list *p;