summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-10-05 19:00:50 +0100
committerRichard van der Hoff <richard@matrix.org>2020-10-05 19:00:50 +0100
commitfd0282201e8876e3a860766fff89561564041260 (patch)
tree22d170c60fcd7884a7b706ef2cf34096ad6bd827 /synapse/handlers/message.py
parentMove shadow-ban check down into `handle_new_client_event`. (diff)
downloadsynapse-fd0282201e8876e3a860766fff89561564041260.tar.xz
pull up event.sender assertion
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 8852db4eaf..5969a7130f 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -664,10 +664,6 @@ class EventCreationHandler:
                 500, "Tried to send member event through non-member codepath"
             )
 
-        user = UserID.from_string(event.sender)
-
-        assert self.hs.is_mine(user), "User must be our own: %s" % (user,)
-
         ev = await self.handle_new_client_event(
             requester=requester,
             event=event,
@@ -748,6 +744,10 @@ class EventCreationHandler:
                 requester, event_dict, token_id=requester.access_token_id, txn_id=txn_id
             )
 
+            assert self.hs.is_mine_id(event.sender), "User must be our own: %s" % (
+                event.sender,
+            )
+
             spam_error = self.spam_checker.check_event_for_spam(event)
             if spam_error:
                 if not isinstance(spam_error, str):