emoji: Start using `get_active_emoji()` in `emoji_name_to_emoji_code()`.

This commit is contained in:
Harshit Bansal 2018-03-18 16:22:07 +00:00 committed by Tim Abbott
parent 23c8da205c
commit 646700b144
1 changed files with 2 additions and 2 deletions

View File

@ -46,9 +46,9 @@ with open(CODEPOINT_TO_NAME_PATH) as fp:
codepoint_to_name = ujson.load(fp) codepoint_to_name = ujson.load(fp)
def emoji_name_to_emoji_code(realm: Realm, emoji_name: Text) -> Tuple[Text, Text]: def emoji_name_to_emoji_code(realm: Realm, emoji_name: Text) -> Tuple[Text, Text]:
realm_emojis = realm.get_emoji() realm_emojis = realm.get_active_emoji()
realm_emoji = realm_emojis.get(emoji_name) realm_emoji = realm_emojis.get(emoji_name)
if realm_emoji is not None and not realm_emoji['deactivated']: if realm_emoji is not None:
return str(realm_emojis[emoji_name]['id']), Reaction.REALM_EMOJI return str(realm_emojis[emoji_name]['id']), Reaction.REALM_EMOJI
if emoji_name == 'zulip': if emoji_name == 'zulip':
return emoji_name, Reaction.ZULIP_EXTRA_EMOJI return emoji_name, Reaction.ZULIP_EXTRA_EMOJI