forked from MirrorHub/synapse
Merge pull request #4758 from matrix-org/erikj/use_presence_replication
When presence is disabled don't send over replication
This commit is contained in:
commit
8267034a63
3 changed files with 9 additions and 2 deletions
1
changelog.d/4757.misc
Normal file
1
changelog.d/4757.misc
Normal file
|
@ -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):
|
def on_edu(self, edu_type, origin, content):
|
||||||
"""Overrides FederationHandlerRegistry
|
"""Overrides FederationHandlerRegistry
|
||||||
"""
|
"""
|
||||||
|
if not self.config.use_presence and edu_type == "m.presence":
|
||||||
|
return
|
||||||
|
|
||||||
handler = self.edu_handlers.get(edu_type)
|
handler = self.edu_handlers.get(edu_type)
|
||||||
if handler:
|
if handler:
|
||||||
return super(ReplicationFederationHandlerRegistry, self).on_edu(
|
return super(ReplicationFederationHandlerRegistry, self).on_edu(
|
||||||
|
|
|
@ -54,8 +54,11 @@ class SlavedPresenceStore(BaseSlavedStore):
|
||||||
|
|
||||||
def stream_positions(self):
|
def stream_positions(self):
|
||||||
result = super(SlavedPresenceStore, self).stream_positions()
|
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
|
return result
|
||||||
|
|
||||||
def process_replication_rows(self, stream_name, token, rows):
|
def process_replication_rows(self, stream_name, token, rows):
|
||||||
|
|
Loading…
Reference in a new issue