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:
parent
5a0e199fc5
commit
735737f0bc
4 changed files with 44 additions and 57 deletions
|
@ -24,7 +24,7 @@
|
|||
} else {
|
||||
if (textsecure.registration.isDone()) {
|
||||
textsecure.subscribeToPush(function(message) {
|
||||
Whisper.Messages.addIncomingMessage(message).then(function() {
|
||||
Whisper.Threads.addIncomingMessage(message).then(function() {
|
||||
console.log("Got message from " + message.pushMessage.source + "." + message.pushMessage.sourceDevice +
|
||||
': "' + getString(message.message.body) + '"');
|
||||
var newUnreadCount = textsecure.storage.getUnencrypted("unreadCount", 0) + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue