diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 56fbab035..43b0df3cf 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -118,7 +118,7 @@ Zotero.Sync = new function() { } - /** + /** * @param {Date} lastSyncDate JS Date object * @param {Zotero.Sync.Server.ObjectKeySet} * @return TRUE if found, FALSE if none, or -1 if last sync time is before start of log @@ -170,6 +170,8 @@ Zotero.Sync = new function() { for (var type in keys) { objectKeySet.addLibraryKeyPairs(type, keys[type]); } + + return true; } @@ -280,7 +282,11 @@ Zotero.Sync.ObjectKeySet.prototype.hasLibraryKey = function (type, libraryID, ke libraryID = 0; } - return this[types] && this[types][libraryID] && this[types][libraryID][key]; + if (this[types] && this[types][libraryID] && this[types][libraryID][key]) { + return true; + } + + return false; } @@ -312,7 +318,6 @@ Zotero.Sync.EventListener = new function () { this.init = init; this.ignoreDeletions = ignoreDeletions; - this.unignoreDeletions = unignoreDeletions; this.notify = notify; var _deleteBlacklist = {}; @@ -343,22 +348,8 @@ Zotero.Sync.EventListener = new function () { } } - - /** - * Remove objects blacklisted from the sync delete log - */ - function unignoreDeletions(type, ids) { - if (!Zotero.Sync.syncObjects[type]) { - throw ("Invalid type '" + type + - "' in Zotero.Sync.EventListener.ignoreDeletions()"); - } - - ids = Zotero.flattenArguments(ids); - for each(var id in ids) { - if (_deleteBlacklist[type][id]) { - delete _deleteBlacklist[type][id]; - } - } + this.resetIgnored = function () { + _deleteBlacklist = {}; } @@ -388,10 +379,11 @@ Zotero.Sync.EventListener = new function () { var ts = Zotero.Date.getUnixTimestamp(); for (var i=0, len=ids.length; i