Allow inviting Matrix users into portal rooms

This commit is contained in:
Tulir Asokan
2018-02-04 22:53:43 +02:00
parent e6afbf96d9
commit 52269eb35e
2 changed files with 13 additions and 4 deletions
+4 -3
View File
@@ -77,12 +77,13 @@ The bridge does not do this automatically.
* [x] Normal chats
* [ ] Supergroups/channels (currently only creator level bridged)
* [ ] Membership actions
* [x] Inviting puppets
* [ ] Inviting Matrix users who have logged in to Telegram
* [x] Inviting
* [x] Puppets
* [x] Matrix users who have logged into Telegram
* [x] Kicking
* [ ] Joining
* [ ] Chat name as alias
* [ ] Chat invite link as alias
* [ ] (Maybe) Chat invite link as alias
* [x] Leaving
* [x] Room metadata changes (name, topic, avatar)
* [x] Initial room metadata
+9 -1
View File
@@ -88,11 +88,19 @@ class MatrixHandler:
elif user == self.az.bot_mxid:
self.az.intent.join_room(room)
return
puppet = Puppet.get_by_mxid(user)
if puppet:
self.handle_puppet_invite(room, puppet, inviter)
return
# These can probably be ignored
user = User.get_by_mxid(user, create=False)
portal = Portal.get_by_mxid(room)
if user and user.has_full_access and portal:
portal.invite_telegram(inviter, user)
return
# The rest can probably be ignored
self.log.debug(f"{inviter} invited {user} to {room}")
def handle_join(self, room, user):