From 59b928d4f763a8b0d7755d4fdb908e5bb1ff53b6 Mon Sep 17 00:00:00 2001 From: gridtime Date: Sat, 9 Mar 2024 15:02:26 +0100 Subject: [PATCH] adds emoji presentation selector --- src/backend/html_markdown.py | 6 ++++-- src/backend/matrix_client.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/backend/html_markdown.py b/src/backend/html_markdown.py index 6a8aac99..1050d701 100644 --- a/src/backend/html_markdown.py +++ b/src/backend/html_markdown.py @@ -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") diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index fc9e5966..cc86854f 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -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)