Ignore events from ourself

This commit is contained in:
Eric Eastwood 2022-12-23 13:46:04 -06:00 committed by Jason Robinson
parent 1a4bc25c59
commit 22f3f54eb3

View file

@ -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 (