commit 5fd3823
green
·
2025-03-24 01:44:58 +0000 UTC
parent d19806a
emojis in usernames in web ui
1 files changed,
+7,
-1
M
html.c
M
html.c
+7,
-1
1@@ -980,10 +980,16 @@ static xs_html *html_user_body(snac *user, int read_only)
2 xs_dict_get(user->config, "uid"),
3 xs_dict_get(srv_config, "host"));
4
5+ // also try to make emojis render in local usernames, specifically in the user info thing in the web ui
6+ xs *name_tags = xs_list_new();
7+ xs *name1 = not_really_markdown(xs_dict_get(user->config, "name"), NULL, &name_tags);
8+ xs *name2 = sanitize(name1);
9+ name2 = replace_shortnames(name2, name_tags, 1, proxy);
10+
11 xs_html_add(top_user,
12 xs_html_tag("p",
13 xs_html_attr("class", "p-name snac-top-user-name"),
14- xs_html_text(xs_dict_get(user->config, "name"))),
15+ xs_html_raw(name2)),
16 xs_html_tag("p",
17 xs_html_attr("class", "snac-top-user-id"),
18 xs_html_text(handle)));