From 7f23d4cf6887321e3a0c2bfdfb5bc57e329f31a2 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 19 Oct 2018 19:31:33 -0600 Subject: [PATCH] Don't try permission checks on rooms that aren't bridged This is the proper way to fix https://github.com/tulir/mautrix-telegram/pull/235 --- mautrix_telegram/portal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py index 1f8c1525..3d865192 100644 --- a/mautrix_telegram/portal.py +++ b/mautrix_telegram/portal.py @@ -196,6 +196,9 @@ class Portal: async def can_user_perform(self, user: 'u.User', event: str, default: int = 50) -> bool: if user.is_admin: return True + if not self.mxid: + # No room for anybody to perform actions in + return False try: await self.main_intent.get_power_levels(self.mxid) except MatrixRequestError: