Fix, display (image) attachments
This commit is contained in:
parent
2820ff8f2d
commit
ee2f43aba4
4 changed files with 17 additions and 4 deletions
|
@ -15,10 +15,16 @@ var Whisper = Whisper || {};
|
|||
comparator: 'timestamp',
|
||||
|
||||
addIncomingMessage: function(decrypted) {
|
||||
//TODO: The data in decrypted (from subscribeToPush) should already be cleaned up
|
||||
var attachments = [];
|
||||
for (var i = 0; i < decrypted.message.attachments.length; i++)
|
||||
attachments[i] = "data:" + decrypted.message.attachments[i].contentType + ";base64," + btoa(getString(decrypted.message.attachments[i].decrypted));
|
||||
|
||||
var m = Whisper.Messages.add({
|
||||
person: decrypted.pushMessage.source,
|
||||
group: decrypted.message.group,
|
||||
body: decrypted.message.body,
|
||||
attachments: attachments,
|
||||
type: 'incoming',
|
||||
timestamp: decrypted.message.timestamp
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue