From 4fe2ccd67024afebda5c355243b9a109f4782309 Mon Sep 17 00:00:00 2001 From: default Date: Mon, 20 Nov 2023 19:47:41 +0100 Subject: [PATCH] html_actor_icon() returns an xs_str instead of adding to another one. --- html.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/html.c b/html.c index 61d2f10..5195ba7 100644 --- a/html.c +++ b/html.c @@ -92,10 +92,10 @@ xs_str *actor_name(xs_dict *actor) } -xs_str *html_actor_icon(xs_str *os, char *actor, - const char *date, const char *udate, const char *url, int priv) +xs_str *html_actor_icon(xs_dict *actor, const char *date, + const char *udate, const char *url, int priv) { - xs *s = xs_str_new(NULL); + xs_str *s = xs_str_new(NULL); xs *avatar = NULL; char *v; @@ -184,7 +184,7 @@ xs_str *html_actor_icon(xs_str *os, char *actor, s = xs_str_cat(s, s1); } - return xs_str_cat(os, s); + return s; } @@ -211,7 +211,8 @@ xs_str *html_msg_icon(xs_str *os, const xs_dict *msg) date = xs_dict_get(msg, "published"); udate = xs_dict_get(msg, "updated"); - os = html_actor_icon(os, actor, date, udate, url, priv); + xs *s1 = html_actor_icon(actor, date, udate, url, priv); + os = xs_str_cat(os, s1); } return os; @@ -1692,9 +1693,10 @@ xs_str *html_people_list(snac *snac, xs_str *os, xs_list *list, const char *head if (valid_status(actor_get(actor_id, &actor))) { s = xs_str_cat(s, "
\n
\n"); - s = html_actor_icon(s, actor, xs_dict_get(actor, "published"), NULL, NULL, 0); - - s = xs_str_cat(s, "
\n"); + { + xs *s1 = html_actor_icon(actor, xs_dict_get(actor, "published"), NULL, NULL, 0); + s = xs_str_cat(s, s1, "
\n"); + } /* content (user bio) */ char *c = xs_dict_get(actor, "summary"); @@ -1898,9 +1900,9 @@ xs_str *html_notifications(snac *snac) if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) { s = xs_str_cat(s, "
\n"); - s = html_actor_icon(s, actor, NULL, NULL, NULL, 0); + xs *s1 = html_actor_icon(actor, NULL, NULL, NULL, 0); - s = xs_str_cat(s, "
\n"); + s = xs_str_cat(s, s1, "\n"); } else { xs *md5 = xs_md5_hex(id, strlen(id));