Handle leaving Matrix rooms

Fixes #28 - Leaving group chat portals leaves the Telegram chat
Fixes #29 - Leaving private chat portals makes the bridge forget that room
This commit is contained in:
Tulir Asokan
2018-01-29 23:01:03 +02:00
parent 4593e1c857
commit b8bcd84c68
4 changed files with 24 additions and 7 deletions
+4 -1
View File
@@ -126,7 +126,10 @@ class MatrixHandler:
def handle_part(self, room, user):
self.log.debug(f"{user} left {room}")
# user = User.get_by_mxid(user, create=False)
user = User.get_by_mxid(user, create=False)
portal = Portal.get_by_mxid(room)
if portal and user.logged_in:
portal.leave_matrix(user)
def is_command(self, message):
text = message.get("body", "")