Merge pull request #4758 from matrix-org/erikj/use_presence_replication

When presence is disabled don't send over replication
pull/14/head
Erik Johnston 6 years ago committed by GitHub
commit 8267034a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/4757.misc
  2. 3
      synapse/federation/federation_server.py
  3. 3
      synapse/replication/slave/storage/presence.py

@ -0,0 +1 @@
When presence is disabled don't send over replication.

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

@ -54,8 +54,11 @@ class SlavedPresenceStore(BaseSlavedStore):
def stream_positions(self):
result = super(SlavedPresenceStore, self).stream_positions()
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):

Loading…
Cancel
Save