snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 544a20fb2ae81fcdf1103f37d6c57428a8d401c4
parent 5fd3823e14639931177656a51e71b74d886d4f9a
Author: green <dandelions@disroot.org>
Date:   Mon, 24 Mar 2025 11:24:39 +0100

EmojiReact notifications show up as emojis

Diffstat:
Mhtml.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/html.c b/html.c @@ -3350,7 +3350,8 @@ xs_str *html_notifications(snac *user, int skip, int show) continue; xs *a_name = actor_name(actor, proxy); - const char *label = type; + xs *label_sanatized = sanitize(type); + const char *label = label_sanatized; if (strcmp(type, "Create") == 0) label = L("Mention"); @@ -3365,7 +3366,8 @@ xs_str *html_notifications(snac *user, int skip, int show) const char *content = xs_dict_get_path(noti, "msg.content"); if (xs_type(content) == XSTYPE_STRING) { - wrk = xs_fmt("%s (%s)", type, content); + xs *emoji = replace_shortnames(xs_dup(content), xs_dict_get_path(noti, "msg.tag"), 1, proxy); + wrk = xs_fmt("%s (%s)", type, emoji); label = wrk; } } @@ -3377,7 +3379,7 @@ xs_str *html_notifications(snac *user, int skip, int show) xs_html *this_html_label = xs_html_container( xs_html_tag("b", - xs_html_text(label), + xs_html_raw(label), xs_html_text(" by "), xs_html_tag("a", xs_html_attr("href", actor_id),