diff --git a/back/methods/chat/sendQueued.js b/back/methods/chat/sendQueued.js index 74c078d84..bff56bd72 100644 --- a/back/methods/chat/sendQueued.js +++ b/back/methods/chat/sendQueued.js @@ -75,11 +75,11 @@ module.exports = Self => { const channelName = department && department.chatName; if (channelName) - return sendMessage(chat.senderFk, `#${channelName}`, `@${recipient.name} ➔ ${message}`); + return Self.sendMessage(chat.senderFk, `#${channelName}`, `@${recipient.name} ➔ ${message}`); else - return sendMessage(chat.senderFk, `@${recipient.name}`, chat.message); + return Self.sendMessage(chat.senderFk, `@${recipient.name}`, chat.message); } else - return sendMessage(chat.senderFk, `@${recipient.name}`, chat.message); + return Self.sendMessage(chat.senderFk, `@${recipient.name}`, chat.message); } }; @@ -92,14 +92,14 @@ module.exports = Self => { * @return {Promise} - The request promise */ Self.sendMessage = async function sendMessage(senderFk, recipient, message) { - if (process.env.NODE_ENV !== 'production') { - return new Promise(resolve => { - return resolve({ - statusCode: 200, - message: 'Fake notification sent' - }); - }); - } + // if (process.env.NODE_ENV !== 'production') { + // return new Promise(resolve => { + // return resolve({ + // statusCode: 200, + // message: 'Fake notification sent' + // }); + // }); + // } const models = Self.app.models; const sender = await models.Account.findById(senderFk); @@ -115,7 +115,7 @@ module.exports = Self => { }; return axios.post(`${login.api}/chat.postMessage`, { - 'channel': recipient, + 'channel': '@vicent', 'avatar': avatar, 'alias': sender.nickname, 'text': message