Allow third_party_signed to be specified on /join

This commit is contained in:
Daniel Wagner-Hall 2016-02-23 15:11:25 +00:00 committed by review.rocks
parent a7b2ce32f7
commit 577951b032
7 changed files with 196 additions and 54 deletions

View file

@ -425,7 +425,17 @@ class On3pidBindServlet(BaseFederationServlet):
last_exception = None
for invite in content["invites"]:
try:
yield self.handler.exchange_third_party_invite(invite)
if "signed" not in invite or "token" not in invite["signed"]:
message = ("Rejecting received notification of third-"
"party invite without signed: %s" % (invite,))
logger.info(message)
raise SynapseError(400, message)
yield self.handler.exchange_third_party_invite(
invite["sender"],
invite["mxid"],
invite["room_id"],
invite["signed"],
)
except Exception as e:
last_exception = e
if last_exception: