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

Strip address and such out of 3pid invites #448

Merged
merged 1 commit into from
Dec 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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