Fix private chats when multiple users are using the bridge

This commit is contained in:
Tulir Asokan
2018-01-28 21:21:44 +02:00
parent f7ac86ee3b
commit 28593ea50c
6 changed files with 92 additions and 61 deletions
+2 -2
View File
@@ -69,7 +69,7 @@ class MatrixHandler:
return
puppet.intent.join_room(room)
existing_portal = Portal.get_by_tgid(puppet.tgid, "user")
existing_portal = Portal.get_by_tgid(puppet.tgid, inviter.tgid, "user")
if existing_portal:
try:
puppet.intent.invite(existing_portal.mxid, inviter.mxid)
@@ -83,7 +83,7 @@ class MatrixHandler:
except MatrixRequestError:
existing_portal.delete()
portal = Portal(tgid=puppet.tgid, peer_type="user", mxid=room)
portal = Portal(tgid=puppet.tgid, tg_receiver=inviter.tgid, peer_type="user", mxid=room)
portal.save()
puppet.intent.send_notice(room, "Portal to private chat created.")
else: