From 7feea5aa6d10f01ea83449babe65d931143466ac Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 13 May 2022 16:29:42 +0300 Subject: [PATCH] Redact QR code after login --- mautrix_telegram/commands/telegram/auth.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mautrix_telegram/commands/telegram/auth.py b/mautrix_telegram/commands/telegram/auth.py index d8cd93fd..853297f6 100644 --- a/mautrix_telegram/commands/telegram/auth.py +++ b/mautrix_telegram/commands/telegram/auth.py @@ -216,6 +216,10 @@ async def login_qr(evt: CommandEvent) -> EventID: return await evt.reply( "Your account has two-factor authentication. Please send your password here." ) + try: + await evt.main_intent.redact(evt.room_id, qr_event_id, reason="QR code scanned") + except Exception: + pass else: timeout = TextMessageEventContent(body="Login timed out", msgtype=MessageType.TEXT) timeout.set_edit(qr_event_id)