Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #448 from matrix-org/daniel/3pid
Browse files Browse the repository at this point in the history
Strip address and such out of 3pid invites
  • Loading branch information
illicitonion committed Dec 17, 2015
2 parents 8b9f471 + 8c5f252 commit 10f82b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion synapse/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def compute_auth_events(self, event, current_state):
if "third_party_invite" in event.content:
key = (
EventTypes.ThirdPartyInvite,
event.content["third_party_invite"]["token"]
event.content["third_party_invite"]["signed"]["token"]
)
third_party_invite = current_state.get(key)
if third_party_invite:
Expand Down
13 changes: 12 additions & 1 deletion synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1650,11 +1650,22 @@ def exchange_third_party_invite(self, invite):
sender = invite["sender"]
room_id = invite["room_id"]

if "signed" not in invite:
logger.info(
"Discarding received notification of third party invite "
"without signed: %s" % (invite,)
)
return

third_party_invite = {
"signed": invite["signed"],
}

event_dict = {
"type": EventTypes.Member,
"content": {
"membership": Membership.INVITE,
"third_party_invite": invite,
"third_party_invite": third_party_invite,
},
"room_id": room_id,
"sender": sender,
Expand Down

0 comments on commit 10f82b4

Please sign in to comment.