From 1f8b7b7d8d5bc3c4a26f17bb60213419e30f8efd Mon Sep 17 00:00:00 2001 From: YashRE42 <33805964+YashRE42@users.noreply.github.com> Date: Fri, 19 Nov 2021 18:19:00 +0530 Subject: [PATCH] emoji: Add code comment complaining about "zulip" emoji special case. --- static/shared/js/emoji.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/static/shared/js/emoji.js b/static/shared/js/emoji.js index dfdf999e61..73fae45d48 100644 --- a/static/shared/js/emoji.js +++ b/static/shared/js/emoji.js @@ -10,6 +10,7 @@ export const emojis_by_name = new Map(); export const all_realm_emojis = new Map(); export const active_realm_emojis = new Map(); +export const deactivated_emoji_name_to_code = new Map(); const default_emoji_aliases = new Map(); @@ -169,8 +170,16 @@ export function update_emojis(realm_emojis) { }); } } - // Add the Zulip emoji to the realm emojis list + + // Add the special Zulip emoji as though it were a realm emoji. + + // The Zulip emoji is the only emoji that uses a string ("zulip") + // as its ID. All other emoji use numeric IDs. This special case + // is confusing; ideally we'd convert the Zulip emoji to be + // implemented using the RealmEmoji infrastructure. all_realm_emojis.set("zulip", zulip_emoji); + + // here "zulip" is an emoji name, which is fine. active_realm_emojis.set("zulip", zulip_emoji); build_emoji_data(active_realm_emojis);