0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-16 15:33:50 +01:00

When presence is enabled don't send over replication

This commit is contained in:
Erik Johnston 2019-02-27 13:53:46 +00:00
parent 7590e9fa28
commit 1e315017d3
2 changed files with 8 additions and 2 deletions

View file

@ -886,6 +886,9 @@ class ReplicationFederationHandlerRegistry(FederationHandlerRegistry):
def on_edu(self, edu_type, origin, content):
"""Overrides FederationHandlerRegistry
"""
if not self.config.use_presence and edu_type == "m.presence":
return
handler = self.edu_handlers.get(edu_type)
if handler:
return super(ReplicationFederationHandlerRegistry, self).on_edu(

View file

@ -54,8 +54,11 @@ class SlavedPresenceStore(BaseSlavedStore):
def stream_positions(self):
result = super(SlavedPresenceStore, self).stream_positions()
position = self._presence_id_gen.get_current_token()
result["presence"] = position
if self.hs.config.use_presence:
position = self._presence_id_gen.get_current_token()
result["presence"] = position
return result
def process_replication_rows(self, stream_name, token, rows):