mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
closes #3977
This commit is contained in:
@@ -101,12 +101,19 @@ module.exports = function(Messaging) {
|
||||
},
|
||||
function (results, next) {
|
||||
if (!results.isOwner) {
|
||||
return next(new Error('[[error:cant-remove-users-to-chat-room]]'));
|
||||
return next(new Error('[[error:cant-remove-users-from-chat-room]]'));
|
||||
}
|
||||
if (results.userCount === 2) {
|
||||
return next(new Error('[[error:cant-remove-last-user]]'));
|
||||
}
|
||||
Messaging.leaveRoom(uids, roomId, next);
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
Messaging.leaveRoom = function(uids, roomId, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
db.sortedSetRemove('chat:room:' + roomId + ':uids', uids, next);
|
||||
},
|
||||
function (next) {
|
||||
|
||||
Reference in New Issue
Block a user