XEP-0444: Fix emoji detection

the emoji lib just released a major release after 5 years, which breaks
the API. This new code is compatible with both.
This commit is contained in:
mathieui 2021-01-24 11:31:17 +01:00
parent b784b68bcd
commit ab280b44cc

View file

@ -10,6 +10,8 @@ from typing import Set, Iterable
from slixmpp.xmlstream import ElementBase from slixmpp.xmlstream import ElementBase
try: try:
from emoji import UNICODE_EMOJI from emoji import UNICODE_EMOJI
if UNICODE_EMOJI.get('en'):
UNICODE_EMOJI = UNICODE_EMOJI['en']
except ImportError: except ImportError:
UNICODE_EMOJI = None UNICODE_EMOJI = None