summary refs log tree commit diff
path: root/synapse/federation/federation_client.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-09-12 08:04:15 +0100
committerGitHub <noreply@github.com>2016-09-12 08:04:15 +0100
commit555460ae1b096675a56f2df60fbfe48f166cb82e (patch)
tree1f3cbc9fb4c03dcc8bc5183761190b9d768e6cd7 /synapse/federation/federation_client.py
parentMerge pull request #1100 from VShell/fix-cas (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/batch_edus (diff)
downloadsynapse-555460ae1b096675a56f2df60fbfe48f166cb82e.tar.xz
Merge pull request #1095 from matrix-org/erikj/batch_edus
Clobber EDUs in send queue
Diffstat (limited to 'synapse/federation/federation_client.py')
-rw-r--r--synapse/federation/federation_client.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py
index 78719eed25..3395c9e41e 100644
--- a/synapse/federation/federation_client.py
+++ b/synapse/federation/federation_client.py
@@ -122,8 +122,12 @@ class FederationClient(FederationBase):
             pdu.event_id
         )
 
+    def send_presence(self, destination, states):
+        if destination != self.server_name:
+            self._transaction_queue.enqueue_presence(destination, states)
+
     @log_function
-    def send_edu(self, destination, edu_type, content):
+    def send_edu(self, destination, edu_type, content, key=None):
         edu = Edu(
             origin=self.server_name,
             destination=destination,
@@ -134,7 +138,7 @@ class FederationClient(FederationBase):
         sent_edus_counter.inc()
 
         # TODO, add errback, etc.
-        self._transaction_queue.enqueue_edu(edu)
+        self._transaction_queue.enqueue_edu(edu, key=key)
         return defer.succeed(None)
 
     @log_function