diff --git a/api/network/receive.ts b/api/network/receive.ts index 53e2fe1..c59a0f1 100644 --- a/api/network/receive.ts +++ b/api/network/receive.ts @@ -30,9 +30,9 @@ async function onReceive(payload){ } } -function forwardMessageToTribe(payload){ - const chat = models.Chat.findOne({where:{uuid:payload.chat.uuid}}) - const sender = models.Contact.findOne({where:{publicKey:payload.sender.pub_key}}) +async function forwardMessageToTribe(payload){ + const chat = await models.Chat.findOne({where:{uuid:payload.chat.uuid}}) + const sender = await models.Contact.findOne({where:{publicKey:payload.sender.pub_key}}) const type = payload.type const message = payload.message sendMessage({ diff --git a/api/network/send.ts b/api/network/send.ts index a550a7d..3af0ba8 100644 --- a/api/network/send.ts +++ b/api/network/send.ts @@ -25,6 +25,9 @@ export async function sendMessage(params) { const isTribe = chat.type===constants.chat_types.tribe const chatUUID = chat.uuid if(isTribe) { + if(type===constants.message_types.confirmation) { + return // dont send confs for tribe + } console.log("is tribe!") const tribeOwnerPubKey = await tribes.verifySignedTimestamp(chatUUID) if(sender.publicKey===tribeOwnerPubKey){ @@ -100,6 +103,8 @@ export function signAndSend(opts, mqttTopic?:string){ } function newmsg(type, chat, sender, message){ + const includeGroupKey = type===constants.message_types.group_create || type===constants.message_types.group_invite + const includeAlias = chat.type===constants.chat_types.tribe return { type: type, chat: { @@ -107,14 +112,15 @@ function newmsg(type, chat, sender, message){ ...chat.name && { name: chat.name }, ...(chat.type||chat.type===0) && { type: chat.type }, ...chat.members && { members: chat.members }, - ...chat.groupKey && { groupKey: chat.groupKey }, - ...chat.host && { host: chat.host } + ...(includeGroupKey&&chat.groupKey) && { groupKey: chat.groupKey }, + ...(includeGroupKey&&chat.host) && { host: chat.host } }, message: message, - // sender: { - // pub_key: sender.publicKey, - // // ...sender.contactKey && {contact_key: sender.contactKey} - // } + sender: { + ...includeAlias && {alias: sender.alias}, + // pub_key: sender.publicKey, + // ...sender.contactKey && {contact_key: sender.contactKey} + } } } diff --git a/dist/api/network/receive.js b/dist/api/network/receive.js index f0c8938..ace3ded 100644 --- a/dist/api/network/receive.js +++ b/dist/api/network/receive.js @@ -42,14 +42,16 @@ function onReceive(payload) { }); } function forwardMessageToTribe(payload) { - const chat = models_1.models.Chat.findOne({ where: { uuid: payload.chat.uuid } }); - const sender = models_1.models.Contact.findOne({ where: { publicKey: payload.sender.pub_key } }); - const type = payload.type; - const message = payload.message; - send_1.sendMessage({ - chat, sender, type, message, - success: () => { }, - receive: () => { } + return __awaiter(this, void 0, void 0, function* () { + const chat = yield models_1.models.Chat.findOne({ where: { uuid: payload.chat.uuid } }); + const sender = yield models_1.models.Contact.findOne({ where: { publicKey: payload.sender.pub_key } }); + const type = payload.type; + const message = payload.message; + send_1.sendMessage({ + chat, sender, type, message, + success: () => { }, + receive: () => { } + }); }); } const ACTIONS = { diff --git a/dist/api/network/receive.js.map b/dist/api/network/receive.js.map index ac17140..de57177 100644 --- a/dist/api/network/receive.js.map +++ b/dist/api/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../api/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAAqC;AACrC,kDAA0C;AAC1C,gDAA0C;AAC1C,0CAAyC;AACzC,kDAAwE;AACxE,sCAAkC;AAClC,iCAAkC;AAElC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAC7E,MAAM,KAAK,GAAG,SAAS,CAAC,aAAa,CAAA;AAErC,MAAM,cAAc,GAAC;IACpB,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,WAAW;CACpE,CAAA;AACD,SAAe,SAAS,CAAC,OAAO;;QAC/B,uCAAuC;QACvC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,KAAG,SAAS,CAAC,UAAU,CAAC,KAAK,CAAA;QAC9D,IAAG,OAAO,IA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,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC9D,IAAG,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/dist/api/network/send.js b/dist/api/network/send.js index da0e0f4..ed266a8 100644 --- a/dist/api/network/send.js +++ b/dist/api/network/send.js @@ -32,6 +32,9 @@ function sendMessage(params) { const isTribe = chat.type === constants.chat_types.tribe; const chatUUID = chat.uuid; if (isTribe) { + if (type === constants.message_types.confirmation) { + return; // dont send confs for tribe + } console.log("is tribe!"); const tribeOwnerPubKey = yield tribes.verifySignedTimestamp(chatUUID); if (sender.publicKey === tribeOwnerPubKey) { @@ -112,10 +115,13 @@ function signAndSend(opts, mqttTopic) { } exports.signAndSend = signAndSend; function newmsg(type, chat, sender, message) { + const includeGroupKey = type === constants.message_types.group_create || type === constants.message_types.group_invite; + const includeAlias = chat.type === constants.chat_types.tribe; return { type: type, - chat: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ uuid: chat.uuid }, chat.name && { name: chat.name }), (chat.type || chat.type === 0) && { type: chat.type }), chat.members && { members: chat.members }), chat.groupKey && { groupKey: chat.groupKey }), chat.host && { host: chat.host }), + chat: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ uuid: chat.uuid }, chat.name && { name: chat.name }), (chat.type || chat.type === 0) && { type: chat.type }), chat.members && { members: chat.members }), (includeGroupKey && chat.groupKey) && { groupKey: chat.groupKey }), (includeGroupKey && chat.host) && { host: chat.host }), message: message, + sender: Object.assign({}, includeAlias && { alias: sender.alias }) }; } function asyncForEach(array, callback) { diff --git a/dist/api/network/send.js.map b/dist/api/network/send.js.map index 4053b5b..575618e 100644 --- a/dist/api/network/send.js.map +++ b/dist/api/network/send.js.map @@ -1 +1 @@ -{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../api/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,sCAA+D;AAC/D,6BAA4B;AAC5B,0CAAyC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAI7E,SAAsB,WAAW,CAAC,MAAM;;QACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;QACxE,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QAC7C,IAAI,GAAG,GAAG,CAAC,CAAA;QAEX,IAAI,UAAU,GAAG,CAAC,OAAO,IAAI,CAAC,UAAU,KAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;QAC1G,IAAG,UAAU,CAAC,MAAM,KAAG,CAAC,EAAE;YACzB,IAAI,UAAU,CAAC,CAAC,CAAC,KAAG,CAAC,EAAE;gBACtB,IAAG,OAAO;oBAAE,OAAO,CAAC,IAAI,CAAC,CAAA;gBACzB,OAAM,CAAC,uDAAu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