diff options
author | Eric Eastwood <erice@element.io> | 2022-12-23 13:46:04 -0600 |
---|---|---|
committer | Jason Robinson <jasonr@element.io> | 2022-12-24 10:43:14 +0200 |
commit | 22f3f54eb3f707d9c823556014872d0b0ea8ad2d (patch) | |
tree | a634f724ea71827b91562bd6e39611ac6234fc35 | |
parent | Use Python 3.11 in Dockerfile (diff) | |
download | synapse-22f3f54eb3f707d9c823556014872d0b0ea8ad2d.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 ( |