summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-12-23 14:20:06 -0600
committerEric Eastwood <erice@element.io>2022-12-23 14:20:06 -0600
commitea0489ba13704a0aef5fd8ce785ff144b9bad01c (patch)
tree62671832d4b5e05be985c3996aa7640ffa1b915f
parentAdd more/better comments (diff)
downloadsynapse-ea0489ba13704a0aef5fd8ce785ff144b9bad01c.tar.xz
Move to after we know not None
-rw-r--r--synapse/appservice/scheduler.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/synapse/appservice/scheduler.py b/synapse/appservice/scheduler.py
index 8afdf0c993..8d17f7b777 100644
--- a/synapse/appservice/scheduler.py
+++ b/synapse/appservice/scheduler.py
@@ -139,14 +139,6 @@ class ApplicationServiceScheduler:
                 to refresh the device lists of, or those that the application service need no
                 longer track the device lists of.
         """
-
-        # XXX: Special patch just for Gitter which we should remove after the import,
-        # https://github.com/matrix-org/synapse/pull/14729
-        #
-        # Ignore events that come from our own users. We probably already know about
-        # them and sent them ourself.
-        events = [event for event in events if not self._hs.is_mine_id(event.sender)]
-
         # We purposefully allow this method to run with empty events/ephemeral
         # collections, so that callers do not need to check iterable size themselves.
         if (
@@ -157,6 +149,13 @@ class ApplicationServiceScheduler:
         ):
             return
 
+        # XXX: Special patch just for Gitter which we should remove after the import,
+        # https://github.com/matrix-org/synapse/pull/14729
+        #
+        # Ignore events that come from our own users. We probably already know about
+        # them and sent them ourself.
+        events = [event for event in events if not self._hs.is_mine_id(event.sender)]
+
         if events:
             self.queuer.queued_events.setdefault(appservice.id, []).extend(events)
         if ephemeral: