chore: eslint prefer-template

This commit is contained in:
Peter Jaszkowiak
2021-02-03 23:59:08 -07:00
committed by Julian Lam
parent 4ee0f1459d
commit 707b55b6a5
357 changed files with 2425 additions and 2427 deletions

View File

@@ -28,21 +28,21 @@ module.exports = function (Messaging) {
uids.forEach(function (uid) {
data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0;
Messaging.pushUnreadCount(uid);
sockets.in('uid_' + uid).emit('event:chats.receive', data);
sockets.in(`uid_${uid}`).emit('event:chats.receive', data);
});
if (messageObj.system) {
return;
}
// Delayed notifications
let queueObj = Messaging.notifyQueue[fromUid + ':' + roomId];
let queueObj = Messaging.notifyQueue[`${fromUid}:${roomId}`];
if (queueObj) {
queueObj.message.content += '\n' + messageObj.content;
queueObj.message.content += `\n${messageObj.content}`;
clearTimeout(queueObj.timeout);
} else {
queueObj = {
message: messageObj,
};
Messaging.notifyQueue[fromUid + ':' + roomId] = queueObj;
Messaging.notifyQueue[`${fromUid}:${roomId}`] = queueObj;
}
queueObj.timeout = setTimeout(function () {
@@ -60,15 +60,15 @@ module.exports = function (Messaging) {
const isGroupChat = await Messaging.isGroupChat(roomId);
const notification = await notifications.create({
type: isGroupChat ? 'new-group-chat' : 'new-chat',
subject: '[[email:notif.chat.subject, ' + messageObj.fromUser.username + ']]',
bodyShort: '[[notifications:new_message_from, ' + messageObj.fromUser.username + ']]',
subject: `[[email:notif.chat.subject, ${messageObj.fromUser.username}]]`,
bodyShort: `[[notifications:new_message_from, ${messageObj.fromUser.username}]]`,
bodyLong: messageObj.content,
nid: 'chat_' + fromuid + '_' + roomId,
nid: `chat_${fromuid}_${roomId}`,
from: fromuid,
path: '/chats/' + messageObj.roomId,
path: `/chats/${messageObj.roomId}`,
});
delete Messaging.notifyQueue[fromuid + ':' + roomId];
delete Messaging.notifyQueue[`${fromuid}:${roomId}`];
notifications.push(notification, uids);
}
};