From 126b1c4f4ca5cf4a98c848a9b9539f087ffc9d7e Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sat, 6 Sep 2014 02:59:40 -0400 Subject: [PATCH] only get 20 chats --- src/controllers/accounts.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js index a9466e4569..903853d562 100644 --- a/src/controllers/accounts.js +++ b/src/controllers/accounts.js @@ -490,7 +490,7 @@ accountsController.getNotifications = function(req, res, next) { accountsController.getChats = function(req, res, next) { async.parallel({ 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) { if (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) { return res.render('chats', { chats: results.recentChats,