This commit is contained in:
barisusakli
2016-03-11 13:38:52 +02:00
parent c156d1cb34
commit 05cc3fe4ef
4 changed files with 34 additions and 3 deletions

View File

@@ -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]]'));