Merge pull request #5702 from matrix-org/babolivier/3pid-invite

Fix check of the association between a 3PID invite and the subsequent m.room.member event in the 3rd party rules
pull/5815/head dinsic_2019-07-18
Brendan Abolivier 2019-07-18 13:38:05 +02:00 committed by GitHub
commit 4dc2eda1d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

1
changelog.d/5702.bugfix Normal file
View File

@ -0,0 +1 @@
Fix 3PID invite to invite association detection in the Tchap room access rules.

View File

@ -454,5 +454,8 @@ class RoomAccessRules(object):
invite (EventBase): The m.room.member event with "invite" membership.
threepid_invite_token (str): The state key from the 3PID invite.
"""
token = invite.content.get("third_party_signed", {}).get("token", "")
token = invite.content.get(
"third_party_invite", {},
).get("signed", {}).get("token", "")
return token == threepid_invite_token