Browse Source

logs

bugfix/timeout-logging
Evan Feenstra 5 years ago
parent
commit
2db28fa94e
  1. 1
      api/controllers/chatTribes.ts
  2. 2
      api/controllers/chats.ts
  3. 1
      dist/api/controllers/chatTribes.js
  4. 2
      dist/api/controllers/chatTribes.js.map
  5. 2
      dist/api/controllers/chats.js
  6. 2
      dist/api/controllers/chats.js.map

1
api/controllers/chatTribes.ts

@ -153,6 +153,7 @@ async function editTribe(req, res) {
}
async function replayChatHistory(chat, contact) {
console.log('replayChatHistory')
if(!(chat&&chat.id&&contact&&contact.id)){
return console.log('[tribes] cant replay history')
}

2
api/controllers/chats.ts

@ -240,6 +240,7 @@ async function receiveGroupJoin(payload) {
const chat = await models.Chat.findOne({ where: { uuid: chat_uuid } })
if (!chat) return
console.log('got chat')
const isTribe = chat_type===constants.chat_types.tribe
@ -253,6 +254,7 @@ async function receiveGroupJoin(payload) {
if(!isTribe || isTribeOwner) { // dont need to create contacts for these
const sender = await models.Contact.findOne({ where: { publicKey: sender_pub_key } })
console.log("sender",sender.dataValues)
const contactIds = JSON.parse(chat.contactIds || '[]')
if (sender) {
theSender = sender // might already include??

1
dist/api/controllers/chatTribes.js

@ -149,6 +149,7 @@ function editTribe(req, res) {
exports.editTribe = editTribe;
function replayChatHistory(chat, contact) {
return __awaiter(this, void 0, void 0, function* () {
console.log('replayChatHistory');
if (!(chat && chat.id && contact && contact.id)) {
return console.log('[tribes] cant replay history');
}

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

File diff suppressed because one or more lines are too long

2
dist/api/controllers/chats.js

@ -231,6 +231,7 @@ function receiveGroupJoin(payload) {
const chat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } });
if (!chat)
return;
console.log('got chat');
const isTribe = chat_type === constants.chat_types.tribe;
var date = new Date();
date.setMilliseconds(0);
@ -241,6 +242,7 @@ function receiveGroupJoin(payload) {
const senderAlias = sender_alias || (member && member.alias) || 'Unknown';
if (!isTribe || isTribeOwner) { // dont need to create contacts for these
const sender = yield models_1.models.Contact.findOne({ where: { publicKey: sender_pub_key } });
console.log("sender", sender.dataValues);
const contactIds = JSON.parse(chat.contactIds || '[]');
if (sender) {
theSender = sender; // might already include??

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

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