From 1ffa300741b3b2633896d8ab4268f3d5a9b2cf27 Mon Sep 17 00:00:00 2001 From: deadcade Date: Thu, 28 Jul 2022 01:05:52 +0200 Subject: [PATCH] Add height parameter to emojis To support upcoming inline images in Element Android, and potentially some other clients. This retains the custom size for emojis (on clients that already supported it), but fixes it on clients that handle scaling exclusively though the height and width of the img element (such as SchildiChat and the upcoming Element Android inline images). --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index dcc901b..7d3df55 100644 --- a/main.py +++ b/main.py @@ -355,7 +355,7 @@ async def message_callback(room: nio.MatrixRoom, event: nio.RoomMessageText) -> with open(settings["emojis_path"], "w") as f: json.dump(emojis, f) # Replace the emoij with the respective file - new_body = new_body.replace(":" + emoji + ":" + ("" if not sizeset else f"{size}:"), f"\"{emoji}\"", 1) + new_body = new_body.replace(":" + emoji + ":" + ("" if not sizeset else f"{size}:"), f"\"{emoji}\"", 1) # Text replace processor if event.body.count(";") > 1: for to_replace in text_replace.keys():