From ce667add2cfedcc6d57c521899dfb9d2e3e6e1d7 Mon Sep 17 00:00:00 2001 From: grunfink Date: Thu, 18 Dec 2025 08:13:54 +0100 Subject: Fixed some xs_join() uses. --- html.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index dae84b7..6ee0707 100644 --- a/html.c +++ b/html.c @@ -72,8 +72,10 @@ xs_str *_replace_shortnames(xs_str *s, const xs_list *tag, int ems, xs *style = xs_fmt("max-height: %dem; max-width: %dem;", ems, ems); xs *class = xs_fmt("snac-emoji snac-emoji-%d-em", ems); - if (cl) - class = xs_str_cat(class, " ", xs_join(cl, " ")); + if (cl) { + xs *l = xs_join(cl, " "); + class = xs_str_cat(class, " ", l); + } int c = 0; const xs_val *v; @@ -2501,9 +2503,10 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, if (!xs_is_null(nb)) { is_emoji = 1; - const char *act = atoi(nb) > 1 ? - xs_fmt("%d different actors \n\t%s", atoi(nb), xs_join(actors, ",\n\t")) : - xs_dict_get(m, "actor"); + xs *al = xs_join(actors, ",\n\t"); + xs *act = atoi(nb) > 1 ? + xs_fmt("%d different actors \n\t%s", atoi(nb), al) : + xs_dup(xs_dict_get(m, "actor")); xs *class = xs_list_new(); class = xs_list_append(class, "snac-reaction"); @@ -2517,6 +2520,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, if (me) class = xs_list_append(class, "snac-reacted"); + xs *l1 = xs_join(class, " "); ret = xs_html_tag("button", xs_html_attr("type", "submit"), xs_html_attr("name", "action"), @@ -2526,7 +2530,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, xs_html_raw(nb), xs_html_attr("style", "padding-left: 5px;")), xs_html_attr("title", act), - xs_html_attr("class", xs_join(class, " "))); + xs_html_attr("class", l1)); if (!(ide && xs_startswith(ide, srv_baseurl))) xs_html_add(ret, xs_html_attr("disabled", "true")); @@ -2540,6 +2544,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, const char *style = "font-size: large;"; if (me) class = xs_list_append(class, "snac-reacted"); + xs *l1 = xs_join(class, " "); ret = xs_html_tag("button", xs_html_attr("type", "submit"), xs_html_attr("name", "action"), @@ -2549,7 +2554,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, xs_html_raw(nb), xs_html_attr("style", "font-size: initial; padding-left: 5px;")), xs_html_attr("title", act), - xs_html_attr("class", xs_join(class, " ")), + xs_html_attr("class", l1), xs_html_attr("style", style)); } } -- cgit v1.2.3