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"
}

@ -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