From ab38029192e87b94923c31f2689a2e7025c47994 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 29 Sep 2022 09:19:42 +0200 Subject: [PATCH] More HTML work. --- html.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/html.c b/html.c index 5b336bc..aca1b30 100644 --- a/html.c +++ b/html.c @@ -143,11 +143,13 @@ int login(snac *snac, char *headers) } -d_char *html_msg_icon(snac *snac, d_char *s, char *msg) +d_char *html_msg_icon(snac *snac, d_char *os, char *msg) { char *actor_id; xs *actor = NULL; + xs *s = xs_str_new(NULL); + if ((actor_id = xs_dict_get(msg, "attributedTo")) == NULL) actor_id = xs_dict_get(msg, "actor"); @@ -202,7 +204,7 @@ d_char *html_msg_icon(snac *snac, d_char *s, char *msg) } } - return s; + return xs_str_cat(os, s); } @@ -480,7 +482,7 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int level) } } - s = xs_str_cat(s, " \n"); + s = xs_str_cat(s, "\n"); char *children = xs_dict_get(meta, "children"); @@ -507,10 +509,10 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int level) left--; } - s = xs_str_cat(s, " \n"); + s = xs_str_cat(s, "\n"); } - s = xs_str_cat(s, " \n"); + s = xs_str_cat(s, "\n"); return xs_str_cat(os, s); } @@ -551,7 +553,7 @@ d_char *html_timeline(snac *snac, char *list, int local) s = html_entry(snac, s, msg, seen, 0); } - s = xs_str_cat(s, " \n"); + s = xs_str_cat(s, "\n"); s = html_user_footer(snac, s);