Merge Whisper.Messages into Whisper Threads
Eliminates the global Whisper.Messages object and consolidates shared send/receive logic in Whisper.Threads. To the latter end, note that the decrypted array buffer on an attachment pointer is now named data instead of decrypted, in order to match the format of outgoing attachments presented by FileReader.readAsArrayBuffers and let us use the same handler to base64 encode them.
This commit is contained in:
@@ -269,7 +269,7 @@ window.textsecure.subscribeToPush = function(message_callback) {
|
||||
var handleAttachment = function(attachment) {
|
||||
return textsecure.api.getAttachment(attachment.id.toString()).then(function(encryptedBin) {
|
||||
return textsecure.protocol.decryptAttachment(encryptedBin, attachment.key.toArrayBuffer()).then(function(decryptedBin) {
|
||||
attachment.decrypted = decryptedBin;
|
||||
attachment.data = decryptedBin;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user