mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 01:56:12 +01:00
fix getRecentChats
This commit is contained in:
@@ -295,10 +295,18 @@ SocketModules.chats.getRecentChats = function(socket, data, callback) {
|
||||
if (!data || !utils.isNumber(data.after)) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
var start = parseInt(data.after, 10),
|
||||
stop = start + 9;
|
||||
var start = parseInt(data.after, 10);
|
||||
var stop = start + 9;
|
||||
if (socket.uid === parseInt(data.uid, 10)) {
|
||||
return Messaging.getRecentChats(socket.uid, start, stop, callback);
|
||||
}
|
||||
|
||||
Messaging.getRecentChats(socket.uid, start, stop, callback);
|
||||
user.isAdminOrGlobalMod(socket.uid, function(err, isAdminOrGlobalMod) {
|
||||
if (err || !isAdminOrGlobalMod) {
|
||||
return callback(err || new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
Messaging.getRecentChats(data.uid, start, stop, callback);
|
||||
});
|
||||
};
|
||||
|
||||
SocketModules.chats.hasPrivateChat = function(socket, uid, callback) {
|
||||
|
||||
Reference in New Issue
Block a user