mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Async remove identity
This commit is contained in:
+2
-2
@@ -38135,7 +38135,7 @@ axolotlInternal.RecipientRecord = function() {
|
|||||||
|
|
||||||
// Use textsecure.storage.devices.removeIdentityKeyForNumber (which calls this) instead
|
// Use textsecure.storage.devices.removeIdentityKeyForNumber (which calls this) instead
|
||||||
_removeIdentityKeyForNumber: function(number) {
|
_removeIdentityKeyForNumber: function(number) {
|
||||||
textsecure.storage.remove("sessions" + number);
|
return Promise.resolve(textsecure.storage.remove("sessions" + number));
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -38187,7 +38187,7 @@ axolotlInternal.RecipientRecord = function() {
|
|||||||
if (map === undefined)
|
if (map === undefined)
|
||||||
throw new Error("Tried to remove identity for unknown number");
|
throw new Error("Tried to remove identity for unknown number");
|
||||||
textsecure.storage.remove("devices" + number);
|
textsecure.storage.remove("devices" + number);
|
||||||
textsecure.storage.sessions._removeIdentityKeyForNumber(number);
|
return textsecure.storage.sessions._removeIdentityKeyForNumber(number);
|
||||||
},
|
},
|
||||||
|
|
||||||
getDeviceObject: function(encodedNumber) {
|
getDeviceObject: function(encodedNumber) {
|
||||||
|
|||||||
@@ -241,12 +241,13 @@
|
|||||||
throw 'No conflicts to resolve';
|
throw 'No conflicts to resolve';
|
||||||
}
|
}
|
||||||
|
|
||||||
textsecure.storage.devices.removeIdentityKeyForNumber(number);
|
return textsecure.storage.devices.removeIdentityKeyForNumber(number).then(function() {
|
||||||
this.messageCollection.each(function(message) {
|
this.messageCollection.each(function(message) {
|
||||||
if (message.hasKeyConflict(number)) {
|
if (message.hasKeyConflict(number)) {
|
||||||
message.resolveConflict(number);
|
message.resolveConflict(number);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}.bind(this));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,7 @@
|
|||||||
},
|
},
|
||||||
resolve: function() {
|
resolve: function() {
|
||||||
new Promise(function(resolve) {
|
new Promise(function(resolve) {
|
||||||
this.conversation.resolveConflicts(this.model.number);
|
this.conversation.resolveConflicts(this.model.number).then(resolve);
|
||||||
resolve();
|
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
this.trigger('resolve');
|
this.trigger('resolve');
|
||||||
this.remove();
|
this.remove();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
// Use textsecure.storage.devices.removeIdentityKeyForNumber (which calls this) instead
|
// Use textsecure.storage.devices.removeIdentityKeyForNumber (which calls this) instead
|
||||||
_removeIdentityKeyForNumber: function(number) {
|
_removeIdentityKeyForNumber: function(number) {
|
||||||
textsecure.storage.remove("sessions" + number);
|
return Promise.resolve(textsecure.storage.remove("sessions" + number));
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
if (map === undefined)
|
if (map === undefined)
|
||||||
throw new Error("Tried to remove identity for unknown number");
|
throw new Error("Tried to remove identity for unknown number");
|
||||||
textsecure.storage.remove("devices" + number);
|
textsecure.storage.remove("devices" + number);
|
||||||
textsecure.storage.sessions._removeIdentityKeyForNumber(number);
|
return textsecure.storage.sessions._removeIdentityKeyForNumber(number);
|
||||||
},
|
},
|
||||||
|
|
||||||
getDeviceObject: function(encodedNumber) {
|
getDeviceObject: function(encodedNumber) {
|
||||||
|
|||||||
Reference in New Issue
Block a user