Browse Source

fix msg replay status

dependabot/npm_and_yarn/ini-1.3.7
Evan Feenstra 4 years ago
parent
commit
7854461908
  1. 4
      dist/src/controllers/messages.js
  2. 2
      dist/src/controllers/messages.js.map
  3. 3
      dist/src/helpers.js
  4. 2
      dist/src/helpers.js.map
  5. 4
      src/controllers/messages.ts
  6. 3
      src/helpers.ts

4
dist/src/controllers/messages.js

@ -217,7 +217,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function*
});
exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function* () {
// console.log('received message', { payload })
const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type, sender_photo_url } = yield helpers.parseReceiveParams(payload);
const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type, sender_photo_url, message_status } = yield helpers.parseReceiveParams(payload);
if (!owner || !sender || !chat) {
return console.log('=> no group chat!');
}
@ -236,7 +236,7 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function
messageContent: text,
createdAt: date,
updatedAt: date,
status: constants_1.default.statuses.received,
status: message_status || constants_1.default.statuses.received,
network_type: network_type,
};
const isTribe = chat_type === constants_1.default.chat_types.tribe;

2
dist/src/controllers/messages.js.map

File diff suppressed because one or more lines are too long

3
dist/src/helpers.js

@ -158,6 +158,7 @@ function parseReceiveParams(payload) {
const amount = dat.message.amount;
const content = dat.message.content;
const remote_content = dat.message.remoteContent;
const message_status = dat.message.status;
const mediaToken = dat.message.mediaToken;
const originalMuid = dat.message.originalMuid;
const msg_id = dat.message.id || 0;
@ -189,7 +190,7 @@ function parseReceiveParams(payload) {
}
chat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } });
}
return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url, network_type };
return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url, network_type, message_status };
});
}
exports.parseReceiveParams = parseReceiveParams;

2
dist/src/helpers.js.map

File diff suppressed because one or more lines are too long

4
src/controllers/messages.ts

@ -244,7 +244,7 @@ export const sendMessage = async (req, res) => {
export const receiveMessage = async (payload) => {
// console.log('received message', { payload })
const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type, sender_photo_url} = await helpers.parseReceiveParams(payload)
const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type, sender_photo_url, message_status} = await helpers.parseReceiveParams(payload)
if(!owner || !sender || !chat) {
return console.log('=> no group chat!')
}
@ -264,7 +264,7 @@ export const receiveMessage = async (payload) => {
messageContent: text,
createdAt: date,
updatedAt: date,
status: constants.statuses.received,
status: message_status || constants.statuses.received,
network_type: network_type,
}
const isTribe = chat_type===constants.chat_types.tribe

3
src/helpers.ts

@ -144,6 +144,7 @@ export async function parseReceiveParams(payload) {
const amount = dat.message.amount
const content = dat.message.content
const remote_content = dat.message.remoteContent
const message_status = dat.message.status
const mediaToken = dat.message.mediaToken
const originalMuid = dat.message.originalMuid
const msg_id = dat.message.id||0
@ -177,7 +178,7 @@ export async function parseReceiveParams(payload) {
}
chat = await models.Chat.findOne({ where: { uuid: chat_uuid } })
}
return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url, network_type }
return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url, network_type, message_status }
}
async function asyncForEach(array, callback) {

Loading…
Cancel
Save