diff options
author | Mark Haines <mark.haines@matrix.org> | 2016-09-07 16:10:51 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2016-09-07 16:10:51 +0100 |
commit | 43954d000e19a622576063de0b48cf9235dec395 (patch) | |
tree | ea6ba106e6455aae45f41609714092b5d89b64f6 /synapse/federation/transaction_queue.py | |
parent | Fix the stream change cache to work over replication (diff) | |
download | synapse-43954d000e19a622576063de0b48cf9235dec395.tar.xz |
Add a new method to enqueue the device messages rather than sending a dummy EDU
Diffstat (limited to 'synapse/federation/transaction_queue.py')
-rw-r--r-- | synapse/federation/transaction_queue.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/federation/transaction_queue.py b/synapse/federation/transaction_queue.py index c0ee946ac0..633c79c352 100644 --- a/synapse/federation/transaction_queue.py +++ b/synapse/federation/transaction_queue.py @@ -157,6 +157,17 @@ class TransactionQueue(object): self._attempt_new_transaction, destination ) + def enqueue_device_messages(self, destination): + if destination == self.server_name or destination == "localhost": + return + + if not self.can_send_to(destination): + return + + preserve_context_over_fn( + self._attempt_new_transaction, destination + ) + @defer.inlineCallbacks def _attempt_new_transaction(self, destination): yield run_on_reactor() |