This commit is contained in:
Barış Soner Uşaklı
2016-10-22 10:24:25 +03:00
parent cbd936c547
commit 4e5d120763

View File

@@ -166,12 +166,12 @@ SocketModules.chats.addUserToRoom = function (socket, data, callback) {
}
async.parallel({
settings: async.apply(user.getSettings, uid),
isAdmin: async.apply(user.isAdministrator, socket.uid),
isAdminOrGlobalMod: async.apply(user.isAdminOrGlobalMod, socket.uid),
isFollowing: async.apply(user.isFollowing, uid, socket.uid)
}, next);
},
function (results, next) {
if (results.settings.restrictChat && !results.isAdmin && !results.isFollowing) {
if (results.settings.restrictChat && !results.isAdminOrGlobalMod && !results.isFollowing) {
return next(new Error('[[error:chat-restricted]]'));
}