Fix attachments
This commit is contained in:
parent
3103eaa192
commit
07a23f0759
3 changed files with 19 additions and 7 deletions
|
@ -321,7 +321,7 @@ function storeMessage(messageObject) {
|
|||
messageMap[messageObject.pushMessage.source] = conversation;
|
||||
}
|
||||
|
||||
conversation[conversation.length] = { message: getString(messageObject.message.body),
|
||||
conversation[conversation.length] = { message: messageObject.message.body != null && getString(messageObject.message.body),
|
||||
sender: messageObject.pushMessage.source,
|
||||
timestamp: messageObject.pushMessage.timestamp.div(dcodeIO.Long.fromNumber(1000)).toNumber() };
|
||||
storage.putEncrypted("messageMap", messageMap);
|
||||
|
@ -465,7 +465,7 @@ function subscribeToPush(message_callback) {
|
|||
return crypto.handleIncomingPushMessageProto(proto).then(function(decrypted) {
|
||||
var handleAttachment = function(attachment) {
|
||||
return API.getAttachment(attachment.id).then(function(encryptedBin) {
|
||||
return crypto.decryptAttachment(encryptedBin, attachment.key).then(function(decryptedBin) {
|
||||
return crypto.decryptAttachment(encryptedBin, toArrayBuffer(attachment.key)).then(function(decryptedBin) {
|
||||
attachment.decrypted = decryptedBin;
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue