diff options
| author | 2025-12-18 08:20:15 +0100 | |
|---|---|---|
| committer | 2025-12-18 08:20:15 +0100 | |
| commit | c8ee70f6df7276b7c02f902cc544d209139697b2 (patch) | |
| tree | aa49a117a01a2e93ca53bc09af50d2925efe7538 /html.c | |
| parent | Fixed some xs_join() uses. (diff) | |
| download | snac2-c8ee70f6df7276b7c02f902cc544d209139697b2.tar.gz snac2-c8ee70f6df7276b7c02f902cc544d209139697b2.tar.xz snac2-c8ee70f6df7276b7c02f902cc544d209139697b2.zip | |
Fixed some xs_fmt() usages.
Diffstat (limited to '')
| -rw-r--r-- | html.c | 11 |
1 files changed, 7 insertions, 4 deletions
| @@ -55,7 +55,7 @@ int login(snac *user, const xs_dict *headers) | |||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | xs_str *_replace_shortnames(xs_str *s, const xs_list *tag, int ems, | 57 | xs_str *_replace_shortnames(xs_str *s, const xs_list *tag, int ems, |
| 58 | const char *proxy, const xs_list *cl, const char *act) | 58 | const char *proxy, const xs_list *cl, const char *act_o) |
| 59 | /* replace but also adds a class list and an actor in its alt text. | 59 | /* replace but also adds a class list and an actor in its alt text. |
| 60 | * Used for emoji reactions */ | 60 | * Used for emoji reactions */ |
| 61 | { | 61 | { |
| @@ -107,7 +107,7 @@ xs_str *_replace_shortnames(xs_str *s, const xs_list *tag, int ems, | |||
| 107 | if (!xs_is_string(mt)) | 107 | if (!xs_is_string(mt)) |
| 108 | mt = xs_mime_by_ext(u); | 108 | mt = xs_mime_by_ext(u); |
| 109 | 109 | ||
| 110 | act = act ? xs_fmt("%s\n%s", n, act) : xs_fmt("%s", n); | 110 | xs *act = act_o ? xs_fmt("%s\n%s", n, act) : xs_fmt("%s", n); |
| 111 | 111 | ||
| 112 | if (strcmp(mt, "image/svg+xml") == 0 && !xs_is_true(xs_dict_get(srv_config, "enable_svg"))) | 112 | if (strcmp(mt, "image/svg+xml") == 0 && !xs_is_true(xs_dict_get(srv_config, "enable_svg"))) |
| 113 | s = xs_replace_i(s, n, ""); | 113 | s = xs_replace_i(s, n, ""); |
| @@ -2479,7 +2479,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2479 | } | 2479 | } |
| 2480 | 2480 | ||
| 2481 | xs *fl = xs_list_new(); | 2481 | xs *fl = xs_list_new(); |
| 2482 | fl = xs_list_append(fl, xs_fmt("%d", count), actors, xs_fmt("%d", me)); | 2482 | xs *c1 = xs_fmt("%d", count); |
| 2483 | xs *c2 = xs_fmt("%d", me); | ||
| 2484 | fl = xs_list_append(fl, c1, actors, c2); | ||
| 2483 | sfrl = xs_dict_append(sfrl, content, fl); | 2485 | sfrl = xs_dict_append(sfrl, content, fl); |
| 2484 | } | 2486 | } |
| 2485 | } | 2487 | } |
| @@ -2545,11 +2547,12 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2545 | if (me) | 2547 | if (me) |
| 2546 | class = xs_list_append(class, "snac-reacted"); | 2548 | class = xs_list_append(class, "snac-reacted"); |
| 2547 | xs *l1 = xs_join(class, " "); | 2549 | xs *l1 = xs_join(class, " "); |
| 2550 | xs *s1 = xs_fmt("&#%d", utf); | ||
| 2548 | ret = xs_html_tag("button", | 2551 | ret = xs_html_tag("button", |
| 2549 | xs_html_attr("type", "submit"), | 2552 | xs_html_attr("type", "submit"), |
| 2550 | xs_html_attr("name", "action"), | 2553 | xs_html_attr("name", "action"), |
| 2551 | xs_html_attr("value", me ? L("EmojiUnreact") : L("EmojiReact")), | 2554 | xs_html_attr("value", me ? L("EmojiUnreact") : L("EmojiReact")), |
| 2552 | xs_html_raw(xs_fmt("&#%d", utf)), | 2555 | xs_html_raw(s1), |
| 2553 | xs_html_tag("span", | 2556 | xs_html_tag("span", |
| 2554 | xs_html_raw(nb), | 2557 | xs_html_raw(nb), |
| 2555 | xs_html_attr("style", "font-size: initial; padding-left: 5px;")), | 2558 | xs_html_attr("style", "font-size: initial; padding-left: 5px;")), |