commit 564b5b1

Haijo7  ·  2023-06-12 08:42:59 +0000 UTC
parent f1294bd
add mastodon profile header to mastodon api
1 files changed,  +10, -0
+10, -0
 1@@ -540,6 +540,16 @@ xs_dict *mastoapi_account(const xs_dict *actor)
 2         avatar = xs_fmt("%s/susie.png", srv_baseurl);
 3 
 4     acct = xs_dict_append(acct, "avatar", avatar);
 5+    acct = xs_dict_append(acct, "avatar_static", avatar);
 6+
 7+    xs *header  = NULL;
 8+    xs_dict *hd = xs_dict_get(actor, "image");
 9+
10+    if (xs_type(hd) == XSTYPE_DICT)
11+        header = xs_dup(xs_dict_get(hd, "url"));
12+
13+    acct = xs_dict_append(acct, "header", header);
14+    acct = xs_dict_append(acct, "header_static", header);
15 
16     /* emojis */
17     xs_list *p;