From 564b5b1161adaab9170f52535e2dfa17edc2a18c Mon Sep 17 00:00:00 2001 From: Haijo7 Date: Mon, 12 Jun 2023 10:42:59 +0200 Subject: [PATCH 1/2] add mastodon profile header to mastodon api --- mastoapi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mastoapi.c b/mastoapi.c index 3b9db28..9c4cf3f 100644 --- 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; From 42958900a04287242ed7a765e3ff337106075cdf Mon Sep 17 00:00:00 2001 From: Haijo7 Date: Mon, 12 Jun 2023 19:01:38 +0200 Subject: [PATCH 2/2] removed additinal empty string --- mastoapi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mastoapi.c b/mastoapi.c index 9c4cf3f..661b8dd 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -586,8 +586,6 @@ xs_dict *mastoapi_account(const xs_dict *actor) acct = xs_dict_append(acct, "emojis", eml); } - acct = xs_dict_append(acct, "header", ""); - return acct; }