From 59d28a8a5cb49d39e757a1b98601d01fa8fffa95 Mon Sep 17 00:00:00 2001 From: Dan Mills Date: Fri, 12 Dec 2008 13:55:26 -0800 Subject: [PATCH] add applyImcoming to store base class --- services/sync/modules/stores.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/services/sync/modules/stores.js b/services/sync/modules/stores.js index d7d86ffefb3..4a5d5e6452c 100644 --- a/services/sync/modules/stores.js +++ b/services/sync/modules/stores.js @@ -84,6 +84,20 @@ Store.prototype = { this._log = Log4Moz.repository.getLogger("Store." + this._logName); }, + applyIncoming: function BStore_applyIncoming(onComplete, record) { + let fn = function(rec) { + let self = yield; + if (!record.cleartext) + this.remove(record); + else if (!this.itemExists(record.id)) + this.create(record); + else + this.update(record); + }; + fn.async(this, onComplete, record); + }, + + // FIXME unused now _applyCommands: function Store__applyCommands(commandList) { let self = yield;