|
@ -157,7 +157,6 @@ function replayChatHistory(chat, contact) { |
|
|
if (m.type !== constants.message_types.message) |
|
|
if (m.type !== constants.message_types.message) |
|
|
return; // only for message for now
|
|
|
return; // only for message for now
|
|
|
const sender = Object.assign(Object.assign({}, owner.dataValues), m.senderAlias && { alias: m.senderAlias }); |
|
|
const sender = Object.assign(Object.assign({}, owner.dataValues), m.senderAlias && { alias: m.senderAlias }); |
|
|
console.log('sender', sender); |
|
|
|
|
|
let content = ''; |
|
|
let content = ''; |
|
|
try { |
|
|
try { |
|
|
content = JSON.parse(m.remoteMessageContent); |
|
|
content = JSON.parse(m.remoteMessageContent); |
|
@ -166,12 +165,9 @@ function replayChatHistory(chat, contact) { |
|
|
if (!content) |
|
|
if (!content) |
|
|
return; |
|
|
return; |
|
|
let msg = network.newmsg(m.type, chat, sender, Object.assign(Object.assign(Object.assign({ content }, m.mediaKey && { mediaKey: m.mediaKey }), m.mediaType && { mediaType: m.mediaType }), m.mediaToken && { mediaToken: m.mediaToken })); |
|
|
let msg = network.newmsg(m.type, chat, sender, Object.assign(Object.assign(Object.assign({ content }, m.mediaKey && { mediaKey: m.mediaKey }), m.mediaType && { mediaType: m.mediaType }), m.mediaToken && { mediaToken: m.mediaToken })); |
|
|
console.log('msg', msg); |
|
|
|
|
|
msg = yield msg_1.decryptMessage(msg, chat); |
|
|
msg = yield msg_1.decryptMessage(msg, chat); |
|
|
const data = yield msg_1.personalizeMessage(msg, contact, true); |
|
|
const data = yield msg_1.personalizeMessage(msg, contact, true); |
|
|
console.log({ data }); |
|
|
|
|
|
const mqttTopic = `${contact.publicKey}/${chat.uuid}`; |
|
|
const mqttTopic = `${contact.publicKey}/${chat.uuid}`; |
|
|
return; |
|
|
|
|
|
yield network.signAndSend({ data }, owner.publicKey, mqttTopic); |
|
|
yield network.signAndSend({ data }, owner.publicKey, mqttTopic); |
|
|
})); |
|
|
})); |
|
|
}); |
|
|
}); |
|
|