mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
closes #4335
This commit is contained in:
@@ -61,7 +61,7 @@ SocketModules.chats.newRoom = function(socket, data, callback) {
|
||||
socket.lastChatMessageTime = now;
|
||||
}
|
||||
|
||||
Messaging.canMessageUser(socket.uid, data.touid, function(err, allowed) {
|
||||
Messaging.canMessageUser(socket.uid, data.touid, function(err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -244,6 +244,18 @@ SocketModules.chats.markRead = function(socket, roomId, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
SocketModules.chats.markAllRead = function(socket, data, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
Messaging.markAllRead(socket.uid, next);
|
||||
},
|
||||
function (next) {
|
||||
Messaging.pushUnreadCount(socket.uid);
|
||||
next();
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
SocketModules.chats.renameRoom = function(socket, data, callback) {
|
||||
if (!data) {
|
||||
return callback(new Error('[[error:invalid-name]]'));
|
||||
|
||||
Reference in New Issue
Block a user