summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-10-04 12:09:05 +0100
committerGitHub <noreply@github.com>2019-10-04 12:09:05 +0100
commitae0b78cb1f8d81a6344d99cb6fd63074336f5a2b (patch)
tree5c49c7ac78238f0341b1f0496654bd6e881d62fc /synapse/handlers
parentUpdate `user_filters` table to have a unique index, and non-null columns (#1172) (diff)
parentTypo (diff)
downloadsynapse-ae0b78cb1f8d81a6344d99cb6fd63074336f5a2b.tar.xz
Merge pull request #6147 from matrix-org/babolivier/3pid-invite-revoked
Don't 500 when trying to exchange a revoked 3PID invite
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/federation.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index f72b81d419..50fc0fde2a 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -2570,7 +2570,7 @@ class FederationHandler(BaseHandler):
         )
 
         try:
-            self.auth.check_from_context(room_version, event, context)
+            yield self.auth.check_from_context(room_version, event, context)
         except AuthError as e:
             logger.warn("Denying third party invite %r because %s", event, e)
             raise e
@@ -2599,7 +2599,12 @@ class FederationHandler(BaseHandler):
                 original_invite_id, allow_none=True
             )
         if original_invite:
-            display_name = original_invite.content["display_name"]
+            # If the m.room.third_party_invite event's content is empty, it means the
+            # invite has been revoked. In this case, we don't have to raise an error here
+            # because the auth check will fail on the invite (because it's not able to
+            # fetch public keys from the m.room.third_party_invite event's content, which
+            # is empty).
+            display_name = original_invite.content.get("display_name")
             event_dict["content"]["third_party_invite"]["display_name"] = display_name
         else:
             logger.info(