mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
chore: eslint prefer-template
This commit is contained in:
committed by
Julian Lam
parent
4ee0f1459d
commit
707b55b6a5
@@ -9,7 +9,7 @@ module.exports = function (Messaging) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return await db.sortedSetCard('uid:' + uid + ':chat:rooms:unread');
|
||||
return await db.sortedSetCard(`uid:${uid}:chat:rooms:unread`);
|
||||
};
|
||||
|
||||
Messaging.pushUnreadCount = async (uid) => {
|
||||
@@ -17,15 +17,15 @@ module.exports = function (Messaging) {
|
||||
return;
|
||||
}
|
||||
const unreadCount = await Messaging.getUnreadCount(uid);
|
||||
sockets.in('uid_' + uid).emit('event:unread.updateChatCount', unreadCount);
|
||||
sockets.in(`uid_${uid}`).emit('event:unread.updateChatCount', unreadCount);
|
||||
};
|
||||
|
||||
Messaging.markRead = async (uid, roomId) => {
|
||||
await db.sortedSetRemove('uid:' + uid + ':chat:rooms:unread', roomId);
|
||||
await db.sortedSetRemove(`uid:${uid}:chat:rooms:unread`, roomId);
|
||||
};
|
||||
|
||||
Messaging.markAllRead = async (uid) => {
|
||||
await db.delete('uid:' + uid + ':chat:rooms:unread');
|
||||
await db.delete(`uid:${uid}:chat:rooms:unread`);
|
||||
};
|
||||
|
||||
Messaging.markUnread = async (uids, roomId) => {
|
||||
@@ -33,7 +33,7 @@ module.exports = function (Messaging) {
|
||||
if (!exists) {
|
||||
throw new Error('[[error:chat-room-does-not-exist]]');
|
||||
}
|
||||
const keys = uids.map(uid => 'uid:' + uid + ':chat:rooms:unread');
|
||||
const keys = uids.map(uid => `uid:${uid}:chat:rooms:unread`);
|
||||
return await db.sortedSetsAdd(keys, Date.now(), roomId);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user