Browse Source

log history date

push-params
Evan Feenstra 4 years ago
parent
commit
ba8bffc571
  1. 7
      dist/src/controllers/chatTribes.js
  2. 2
      dist/src/controllers/chatTribes.js.map
  3. 6
      src/controllers/chatTribes.ts

7
dist/src/controllers/chatTribes.js

@ -418,6 +418,7 @@ function replayChatHistory(chat, contact) {
if (!(chat && chat.id && contact && contact.id)) {
return console.log('[tribes] cant replay history');
}
try {
const msgs = yield models_1.models.Message.findAll({
where: { chatId: chat.id, type: { [sequelize_1.Op.in]: network.typesToReplay } },
order: [['id', 'desc']],
@ -434,6 +435,8 @@ function replayChatHistory(chat, contact) {
content = JSON.parse(m.remoteMessageContent);
}
catch (e) { }
console.log("HISTORY DATE", m.date, typeof m.date);
console.log("HISTORY DATE STRING", m.date.toISOString());
const dateString = m.date && m.date.toISOString();
let mediaKeyMap;
let newMediaTerms;
@ -460,6 +463,10 @@ function replayChatHistory(chat, contact) {
dest: contact.publicKey,
}, mqttTopic, replayingHistory);
}));
}
catch (e) {
console.log('replayChatHistory ERROR', e);
}
});
}
exports.replayChatHistory = replayChatHistory;

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

File diff suppressed because one or more lines are too long

6
src/controllers/chatTribes.ts

@ -419,6 +419,7 @@ export async function replayChatHistory(chat, contact) {
if(!(chat&&chat.id&&contact&&contact.id)){
return console.log('[tribes] cant replay history')
}
try {
const msgs = await models.Message.findAll({
where:{chatId:chat.id, type:{[Op.in]:network.typesToReplay}},
order: [['id', 'desc']],
@ -436,6 +437,8 @@ export async function replayChatHistory(chat, contact) {
let content = ''
try {content = JSON.parse(m.remoteMessageContent)} catch(e) {}
console.log("HISTORY DATE",m.date,typeof m.date)
console.log("HISTORY DATE STRING",m.date.toISOString())
const dateString = m.date&&m.date.toISOString()
let mediaKeyMap
let newMediaTerms
@ -468,6 +471,9 @@ export async function replayChatHistory(chat, contact) {
dest: contact.publicKey,
}, mqttTopic, replayingHistory)
})
} catch(e) {
console.log('replayChatHistory ERROR', e)
}
}
export async function createTribeChatParams(owner, contactIds, name, img, price_per_message, price_to_join, escrow_amount, escrow_millis, unlisted, is_private, app_url): Promise<{[k:string]:any}> {

Loading…
Cancel
Save