commit 748b578
grunfink
·
2026-08-30 05:43:18 +0000 UTC
parent f6f1819
Fixed EmojiReact code to allow any emoticon in emojis.json, not only those with colon-wrapped ids.
2 files changed,
+3,
-5
M
html.c
+3,
-3
1@@ -1607,7 +1607,7 @@ xs_dict *msg_emoji_init(snac *snac, const char *mid, const char *eid_o)
2 {
3 xs_dict *n_msg = msg_admiration(snac, mid, "EmojiReact");
4
5- xs *eid = xs_strip_chars_i(xs_dup(eid_o), ":");
6+ xs *eid = xs_dup(eid_o);
7 xs *content = NULL;
8 xs *tag = xs_list_new();
9 xs *dict = xs_dict_new();
10@@ -1623,14 +1623,14 @@ xs_dict *msg_emoji_init(snac *snac, const char *mid, const char *eid_o)
11 content = xs_dup(eid);
12
13 else if (*eid == '%') {
14- content = xs_url_dec_emoji(xs_dup(eid));
15+ content = xs_url_dec_emoji(eid);
16 if (content == NULL) {
17 xs_free(n_msg);
18 return NULL;
19 }
20 }
21 else {
22- content = xs_fmt(":%s:", eid);
23+ content = xs_dup(eid);
24 const char *emo = xs_dict_get(emjs, content);
25
26 if (emo == NULL) {
M
html.c
+0,
-2
1@@ -5727,8 +5727,6 @@ int html_post_handler(const xs_dict *req, const char *q_path,
2 if (strcmp(action, L("EmojiReact")) == 0) { /** **/
3 xs *eid = xs_dup(xs_dict_get(p_vars, "eid"));
4
5- eid = xs_strip_chars_i(eid, ":");
6-
7 xs *ret = msg_emoji_init(&snac, id, eid);
8 /* fails if either invalid or already reacted */
9 if (!ret) {