Bug 1332556 - Set correct passwords' timestamps on first Sync. r?markh
MozReview-Commit-ID: Izg9sIeGNJo
--- a/services/sync/modules/engines/passwords.js
+++ b/services/sync/modules/engines/passwords.js
@@ -76,30 +76,40 @@ PasswordEngine.prototype = {
this._log.debug("Password deletes failed", ex);
}
}
},
_findDupe(item) {
let login = this._store._nsLoginInfoFromRecord(item);
if (!login) {
- return;
+ return null;
}
let logins = Services.logins.findLogins({}, login.hostname, login.formSubmitURL, login.httpRealm);
this._store._sleep(0); // Yield back to main thread after synchronous operation.
// Look for existing logins that match the hostname, but ignore the password.
for (let local of logins) {
if (login.matches(local, true) && local instanceof Ci.nsILoginMetaInfo) {
return local.guid;
}
}
+
+ return null;
},
+
+ pullAllChanges() {
+ let changeset = new Changeset();
+ for (let [id, info] of Object.entries(this._store.getAllIDs())) {
+ changeset.set(id, info.timePasswordChanged);
+ }
+ return changeset;
+ }
};
function PasswordStore(name, engine) {
Store.call(this, name, engine);
this._nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo, "init");
}
PasswordStore.prototype = {
__proto__: Store.prototype,