mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-24 01:10:31 +01:00
only get 20 chats
This commit is contained in:
@@ -490,7 +490,7 @@ accountsController.getNotifications = function(req, res, next) {
|
|||||||
accountsController.getChats = function(req, res, next) {
|
accountsController.getChats = function(req, res, next) {
|
||||||
async.parallel({
|
async.parallel({
|
||||||
contacts: async.apply(user.getFollowing, req.user.uid),
|
contacts: async.apply(user.getFollowing, req.user.uid),
|
||||||
recentChats: async.apply(messaging.getRecentChats, req.user.uid, 0, -1)
|
recentChats: async.apply(messaging.getRecentChats, req.user.uid, 0, 19)
|
||||||
}, function(err, results) {
|
}, function(err, results) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
@@ -507,10 +507,6 @@ accountsController.getChats = function(req, res, next) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.recentChats.length > 20) {
|
|
||||||
results.recentChats.length = 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!req.params.userslug) {
|
if (!req.params.userslug) {
|
||||||
return res.render('chats', {
|
return res.render('chats', {
|
||||||
chats: results.recentChats,
|
chats: results.recentChats,
|
||||||
|
|||||||
Reference in New Issue
Block a user