diff options
Diffstat (limited to 'client/src/leap/soledad/client/http_target')
-rw-r--r-- | client/src/leap/soledad/client/http_target/fetch.py | 8 | ||||
-rw-r--r-- | client/src/leap/soledad/client/http_target/send.py | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/client/src/leap/soledad/client/http_target/fetch.py b/client/src/leap/soledad/client/http_target/fetch.py index 087da3a3..9f7a4193 100644 --- a/client/src/leap/soledad/client/http_target/fetch.py +++ b/client/src/leap/soledad/client/http_target/fetch.py @@ -44,6 +44,7 @@ class HTTPDocFetcher(object): # if the sync status event is meant to be used somewhere else. uuid = 'undefined' + userid = 'undefined' @defer.inlineCallbacks def _receive_docs(self, last_known_generation, last_known_trans_id, @@ -182,7 +183,8 @@ class HTTPDocFetcher(object): # end of symmetric decryption # ------------------------------------------------------------- self._received_docs += 1 - _emit_receive_status(self.uuid, self._received_docs, total) + user_data = {'uuid': self.uuid, 'userid': self.userid} + _emit_receive_status(user_data, self._received_docs, total) return number_of_changes, new_generation, new_transaction_id def _parse_received_doc_response(self, response): @@ -249,9 +251,9 @@ class HTTPDocFetcher(object): source_replica_uid=self.source_replica_uid) -def _emit_receive_status(uuid, received_docs, total): +def _emit_receive_status(user_data, received_docs, total): content = {'received': received_docs, 'total': total} - emit_async(SOLEDAD_SYNC_RECEIVE_STATUS, uuid, content) + emit_async(SOLEDAD_SYNC_RECEIVE_STATUS, user_data, content) if received_docs % 20 == 0: msg = "%d/%d" % (received_docs, total) diff --git a/client/src/leap/soledad/client/http_target/send.py b/client/src/leap/soledad/client/http_target/send.py index 3fc5a171..89288779 100644 --- a/client/src/leap/soledad/client/http_target/send.py +++ b/client/src/leap/soledad/client/http_target/send.py @@ -36,6 +36,7 @@ class HTTPDocSender(object): # if the sync status event is meant to be used somewhere else. uuid = 'undefined' + userid = 'undefined' @defer.inlineCallbacks def _send_docs(self, docs_by_generation, last_known_generation, @@ -78,6 +79,7 @@ class HTTPDocSender(object): if self._defer_encryption: self._delete_sent(sent) + user_data = {'uuid': self.uuid, 'userid': self.userid} _emit_send_status(self.uuid, body.consumed, total) defer.returnValue(result) @@ -119,9 +121,9 @@ class HTTPDocSender(object): return d -def _emit_send_status(uuid, idx, total): +def _emit_send_status(user_data, idx, total): content = {'sent': idx, 'total': total} - emit_async(SOLEDAD_SYNC_SEND_STATUS, uuid, content) + emit_async(SOLEDAD_SYNC_SEND_STATUS, user_data, content) msg = "%d/%d" % (idx, total) logger.debug("Sync send status: %s" % msg) |