summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--activitypub.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index e1f3210..59df31a 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1643,7 +1643,22 @@ xs_dict *msg_emoji_init(snac *snac, const char *mid, const char *eid_o)
1643 dict = xs_dict_set(dict, "type", "Emoji"); 1643 dict = xs_dict_set(dict, "type", "Emoji");
1644 tag = xs_list_append(tag, dict); 1644 tag = xs_list_append(tag, dict);
1645 } 1645 }
1646 else
1647 if (xs_startswith(emo, "&#")) {
1648 /* snac default emoji as an HTML entity: decode */
1649 content = xs_free(content);
1650
1651 xs *s1 = xs_strip_chars_i(xs_dup(emo), "&#");
1652 unsigned int cpoint = 0;
1653 sscanf(s1, "%u;", &cpoint);
1654
1655 if (cpoint)
1656 content = xs_utf8_cat(xs_str_new(NULL), cpoint);
1657 else
1658 content = xs_dup(emo);
1659 }
1646 else { 1660 else {
1661 /* use as it is and hope for the best */
1647 xs_free(content); 1662 xs_free(content);
1648 content = xs_dup(emo); 1663 content = xs_dup(emo);
1649 } 1664 }