Browse Source

try

feature/dockerfile-arm
Evan Feenstra 5 years ago
parent
commit
680ccb1c84
  1. 5
      api/controllers/chatTribes.ts
  2. 4
      dist/api/controllers/chatTribes.js
  3. 2
      dist/api/controllers/chatTribes.js.map

5
api/controllers/chatTribes.ts

@ -161,6 +161,7 @@ async function replayChatHistory(chat, contact) {
...owner.dataValues,
...m.senderAlias && {alias: m.senderAlias},
}
console.log('sender',sender)
let content = ''
try {content = JSON.parse(m.remoteMessageContent)} catch(e) {}
if(!content) return
@ -170,10 +171,12 @@ async function replayChatHistory(chat, contact) {
...m.mediaType && {mediaType: m.mediaType},
...m.mediaToken && {mediaToken: m.mediaToken}
})
console.log('msg',msg)
msg = await decryptMessage(msg, chat)
const data = await personalizeMessage(msg, contact, true)
console.log({data})
const mqttTopic = `${contact.publicKey}/${chat.uuid}`
return
await network.signAndSend({data}, owner.publicKey, mqttTopic)
})
}

4
dist/api/controllers/chatTribes.js

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

2
dist/api/controllers/chatTribes.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save