mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 10:06:13 +01:00
various group chat fixes #3980
fix multiple modals using the same tagsinput fix online user getting chat notification fix owner not being able to remove users in the chat modal
This commit is contained in:
@@ -101,20 +101,27 @@ SocketModules.chats.send = function(socket, data, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
SocketModules.chats.getUsersInRoom = function(socket, data, callback) {
|
||||
SocketModules.chats.loadRoom = function(socket, data, callback) {
|
||||
if (!data || !data.roomId) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
|
||||
var isOwner = false;
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
Messaging.isUserInRoom(socket.uid, data.roomId, next);
|
||||
async.parallel({
|
||||
inRoom: async.apply(Messaging.isUserInRoom, socket.uid, data.roomId),
|
||||
isOwner: async.apply(Messaging.isRoomOwner, socket.uid, data.roomId)
|
||||
}, next);
|
||||
},
|
||||
function (inRoom, next) {
|
||||
if (!inRoom) {
|
||||
function (results, next) {
|
||||
if (!results.inRoom) {
|
||||
return next(new Error('[[error:not-allowerd]]'));
|
||||
}
|
||||
isOwner = results.isOwner;
|
||||
Messaging.getUsersInRoom(data.roomId, 0, -1, next);
|
||||
},
|
||||
function (users, next) {
|
||||
next(null, {users: users, owner: isOwner});
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user