throw error in chat if no users in room

v1.18.x
pichalite 9 years ago
parent 18bc7713ef
commit 6ecc05afd4

@ -124,5 +124,6 @@
"invite-maximum-met": "You have invited the maximum amount of people (%1 out of %2).",
"no-session-found": "No login session found!",
"not-in-room": "User not in room"
"not-in-room": "User not in room",
"no-users-in-room": "No users in this room"
}

@ -359,7 +359,7 @@ var async = require('async'),
if (parseInt(meta.config.disableChat) === 1 || !uid) {
return callback(new Error('[[error:chat-disabled]]'));
}
async.waterfall([
function (next) {
Messaging.isUserInRoom(uid, roomId, next);
@ -368,6 +368,14 @@ var async = require('async'),
if (!inRoom) {
return next(new Error('[[error:not-in-room]]'));
}
Messaging.getUserCountInRoom(roomId, next);
},
function(count, next) {
if (count < 2) {
return next(new Error('[[error:no-users-in-room]]'));
}
user.getUserFields(uid, ['banned', 'email:confirmed'], next);
},
function (userData, next) {

Loading…
Cancel
Save