From d332a429d670459eb076fe60be764492db242265 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 28 Apr 2018 22:09:40 +0300 Subject: [PATCH] Add option to disable native stickers. Fixes #116 --- example-config.yaml | 5 +++++ mautrix_telegram/config.py | 1 + mautrix_telegram/portal.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/example-config.yaml b/example-config.yaml index 627f923d..6f22062f 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -100,6 +100,11 @@ bridge: plaintext_highlights: false # Whether or not to make portals of publicly joinable channels/supergroups publicly joinable on Matrix. public_portals: true + # Whether to send stickers as the new native m.sticker type or normal m.images. + # Old versions of Riot don't support the new type at all. + # + # Remember that proper sticker support always requires Pillow to convert webp into png. + native_stickers: true # The prefix for commands. Only required in non-management rooms. command_prefix: "!tg" diff --git a/mautrix_telegram/config.py b/mautrix_telegram/config.py index 55b4ad46..e3c60b04 100644 --- a/mautrix_telegram/config.py +++ b/mautrix_telegram/config.py @@ -176,6 +176,7 @@ class Config(DictWithRecursion): copy("bridge.inline_images") copy("bridge.plaintext_highlights") copy("bridge.public_portals") + copy("bridge.native_stickers") copy("bridge.command_prefix") diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py index eab47a81..6772a2fe 100644 --- a/mautrix_telegram/portal.py +++ b/mautrix_telegram/portal.py @@ -1050,7 +1050,7 @@ class Portal: "external_url": self.get_external_url(evt) } - if attrs["is_sticker"]: + if attrs["is_sticker"] and config["bridge.native_stickers"]: return await intent.send_sticker(**kwargs) mime_type = info["mimetype"]