diff options
author | Eric Eastwood <erice@element.io> | 2022-12-23 13:46:04 -0600 |
---|---|---|
committer | Eric Eastwood <erice@element.io> | 2022-12-23 13:46:04 -0600 |
commit | 36d154799679f921fc3b13eefe1011e4f49e7cc6 (patch) | |
tree | e7a834404bdb145996013d2cd055f4d7a7347ce2 | |
parent | Log to-device msgids when we return them over /sync (#14724) (diff) | |
download | synapse-36d154799679f921fc3b13eefe1011e4f49e7cc6.tar.xz |
Ignore events from ourself
-rw-r--r-- | synapse/appservice/scheduler.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/appservice/scheduler.py b/synapse/appservice/scheduler.py index 7b562795a3..b1029d59da 100644 --- a/synapse/appservice/scheduler.py +++ b/synapse/appservice/scheduler.py @@ -98,6 +98,7 @@ class ApplicationServiceScheduler: """ def __init__(self, hs: "HomeServer"): + self._hs = hs self.clock = hs.get_clock() self.store = hs.get_datastores().main self.as_api = hs.get_application_service_api() @@ -138,6 +139,11 @@ class ApplicationServiceScheduler: to refresh the device lists of, or those that the application service need no longer track the device lists of. """ + + # 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 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 ( |