summaryrefslogtreecommitdiffstats
path: root/services/sync/modules/engines/clients.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-10-06 07:09:02 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-10-06 07:09:02 +0200
commit18473f1844a8230130e1fc23d7ebf7d33183316f (patch)
tree75d297ab7eac48e14af88e565dc1e19775de9df1 /services/sync/modules/engines/clients.js
parent0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25 (diff)
downloadUXP-18473f1844a8230130e1fc23d7ebf7d33183316f.tar
UXP-18473f1844a8230130e1fc23d7ebf7d33183316f.tar.gz
UXP-18473f1844a8230130e1fc23d7ebf7d33183316f.tar.lz
UXP-18473f1844a8230130e1fc23d7ebf7d33183316f.tar.xz
UXP-18473f1844a8230130e1fc23d7ebf7d33183316f.zip
Update sync client for JS changes.
Diffstat (limited to 'services/sync/modules/engines/clients.js')
-rw-r--r--services/sync/modules/engines/clients.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/services/sync/modules/engines/clients.js b/services/sync/modules/engines/clients.js
index f423242c9..6c8e37a7b 100644
--- a/services/sync/modules/engines/clients.js
+++ b/services/sync/modules/engines/clients.js
@@ -7,7 +7,7 @@ this.EXPORTED_SYMBOLS = [
"ClientsRec"
];
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://services-common/stringbundle.js");
Cu.import("resource://services-sync/constants.js");
@@ -66,10 +66,13 @@ ClientEngine.prototype = {
numClients: 1,
};
- for each (let {name, type} in this._store._remoteClients) {
- stats.hasMobile = stats.hasMobile || type == "mobile";
- stats.names.push(name);
- stats.numClients++;
+ for (let id in this._store._remoteClients) {
+ let {name, type, stale} = this._store._remoteClients[id];
+ if (!stale) {
+ stats.hasMobile = stats.hasMobile || type == DEVICE_TYPE_MOBILE;
+ stats.names.push(name);
+ stats.numClients++;
+ }
}
return stats;
@@ -85,7 +88,11 @@ ClientEngine.prototype = {
counts.set(this.localType, 1);
- for each (let record in this._store._remoteClients) {
+ for (let id in this._store._remoteClients) {
+ let record = this._store._remoteClients[id];
+ if (record.stale) {
+ continue; // pretend "stale" records don't exist.
+ }
let type = record.type;
if (!counts.has(type)) {
counts.set(type, 0);