Divorce identity wipe from tryAgain functions

We'd like to live in a world where we can retry all the pending
conflicts in a conversation as a batch, which means we don't want to
wipe the identity key before processing each message. Thus, remove that
step from these handlers and encapsulate in a method on the conversation
model.
This commit is contained in:
lilia 2015-02-23 16:23:22 -08:00
parent c642854ddf
commit 857eee5003
5 changed files with 46 additions and 14 deletions

View file

@ -119,11 +119,9 @@
}
};
var wipeIdentityAndTryMessageAgain = function(from, encodedMessage) {
// Wipe identity key!
textsecure.storage.devices.removeIdentityKeyForNumber(from.split('.')[0]);
var tryMessageAgain = function(from, encodedMessage) {
//TODO: Probably breaks with a devicecontrol message
return textsecure.protocol_wrapper.handlePreKeyWhisperMessage(from, encodedMessage).then(decodeMessageContents);
}
textsecure.replay.registerFunction(wipeIdentityAndTryMessageAgain, textsecure.replay.Type.INIT_SESSION);
textsecure.replay.registerFunction(tryMessageAgain, textsecure.replay.Type.INIT_SESSION);
})();