mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 14:35:04 +00:00
Some software return a list of icons instead of one, because why not.
This commit is contained in:
parent
7d83679617
commit
a453c01f32
1 changed files with 7 additions and 3 deletions
10
html.c
10
html.c
|
@ -113,9 +113,13 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date,
|
||||||
xs *name = actor_name(actor);
|
xs *name = actor_name(actor);
|
||||||
|
|
||||||
/* get the avatar */
|
/* get the avatar */
|
||||||
if ((v = xs_dict_get(actor, "icon")) != NULL &&
|
if ((v = xs_dict_get(actor, "icon")) != NULL) {
|
||||||
(v = xs_dict_get(v, "url")) != NULL) {
|
/* if it's a list (Peertube), get the first one */
|
||||||
avatar = xs_dup(v);
|
if (xs_type(v) == XSTYPE_LIST)
|
||||||
|
v = xs_list_get(v, 0);
|
||||||
|
|
||||||
|
if ((v = xs_dict_get(v, "url")) != NULL)
|
||||||
|
avatar = xs_dup(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avatar == NULL)
|
if (avatar == NULL)
|
||||||
|
|
Loading…
Reference in a new issue