adds emoji presentation selector

This commit is contained in:
gridtime 2024-03-09 15:02:26 +01:00 committed by Maze
parent 12902d126c
commit 59b928d4f7
2 changed files with 6 additions and 3 deletions

View File

@ -221,9 +221,11 @@ class HTMLProcessor:
for node in tree.iterdescendants():
if node.tag != "code" and node.text:
node.text = emoji.emojize(node.text, language="alias")
node.text = emoji.emojize(
node.text, language="alias", variant="emoji_type")
if node.getparent() and node.getparent().tag != "code" and node.tail:
node.tail = emoji.emojize(node.tail, language="alias")
node.tail = emoji.emojize(
node.tail, language="alias", variant="emoji_type")
html = etree.tostring(tree, encoding="utf-8", method="html").decode()
html = sanit.sanitize(html).rstrip("\n")

View File

@ -773,7 +773,8 @@ class MatrixClient(nio.AsyncClient):
await self.send_fake_notice(
room_id, "Please reply to a message to react to it")
else:
reaction = emoji.emojize(text, language="alias")
reaction = emoji.emojize(
text, language="alias", variant="emoji_type")
await self.send_reaction(room_id, reaction, reply_to_event_id)