diff --git a/mautrix_telegram/config.py b/mautrix_telegram/config.py index 2e16b962..f17ddc42 100644 --- a/mautrix_telegram/config.py +++ b/mautrix_telegram/config.py @@ -156,6 +156,7 @@ class Config(BaseBridgeConfig): copy("bridge.private_chat_portal_meta") if base["bridge.private_chat_portal_meta"] not in ("default", "always", "never"): base["bridge.private_chat_portal_meta"] = "default" + copy("bridge.disable_reply_fallbacks") copy("bridge.delivery_receipts") copy("bridge.delivery_error_reports") copy("bridge.incoming_bridge_error_reports") diff --git a/mautrix_telegram/example-config.yaml b/mautrix_telegram/example-config.yaml index 9d8f6263..d72a7654 100644 --- a/mautrix_telegram/example-config.yaml +++ b/mautrix_telegram/example-config.yaml @@ -331,6 +331,9 @@ bridge: # If set to `always`, all DM rooms will have explicit names and avatars set. # If set to `never`, DM rooms will never have names and avatars set. private_chat_portal_meta: default + # Disable generating reply fallbacks? Some extremely bad clients still rely on them, + # but they're being phased out and will be completely removed in the future. + disable_reply_fallbacks: false # Whether or not the bridge should send a read receipt from the bridge bot when a message has # been sent to Telegram. delivery_receipts: false diff --git a/mautrix_telegram/portal_util/message_convert.py b/mautrix_telegram/portal_util/message_convert.py index e7ee0730..c9540723 100644 --- a/mautrix_telegram/portal_util/message_convert.py +++ b/mautrix_telegram/portal_util/message_convert.py @@ -259,6 +259,7 @@ class TelegramMessageConverter: ) reply_to_id = TelegramID(evt.reply_to.reply_to_msg_id) msg = await DBMessage.get_one_by_tgid(reply_to_id, space) + no_fallback = no_fallback or self.config["bridge.disable_reply_fallbacks"] if not msg or msg.mx_room != self.portal.mxid: if deterministic_id: content.set_reply(self.deterministic_event_id(space, reply_to_id))