Add command to forget portal room. Fixes #30

This commit is contained in:
Tulir Asokan
2018-01-29 23:46:46 +02:00
parent b8bcd84c68
commit f843fd7e85
4 changed files with 36 additions and 4 deletions
+7 -2
View File
@@ -40,7 +40,12 @@ class User:
self.command_status = None
self.connected = False
self.client = None
whitelist = config.get("bridge", {}).get("whitelist", None) or [self.mxid]
bridge_config = config.get("bridge", {})
self.is_admin = self.mxid in bridge_config.get("admins", [])
whitelist = bridge_config.get("whitelist", None) or [self.mxid]
self.whitelisted = not whitelist or self.mxid in whitelist
if not self.whitelisted:
homeserver = self.mxid[self.mxid.index(":") + 1:]
@@ -185,7 +190,7 @@ class User:
for dialog in dialogs:
entity = dialog.entity
if (isinstance(entity, (TLUser, ChatForbidden, ChannelForbidden)) or (
isinstance(entity, Chat) and entity.deactivated)):
isinstance(entity, Chat) and (entity.deactivated or entity.left))):
continue
portal = po.Portal.get_by_entity(entity)
portal.create_matrix_room(self, entity, invites=[self.mxid])