From 3f31098144c278b2834a2e7389f0e0c98a327dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 11 Feb 2015 16:16:32 -0500 Subject: [PATCH] closes #2619 --- src/controllers/accounts.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/accounts.js b/src/controllers/accounts.js index 77cbe1008b..13055ca852 100644 --- a/src/controllers/accounts.js +++ b/src/controllers/accounts.js @@ -521,9 +521,10 @@ accountsController.getChats = function(req, res, next) { async.waterfall([ async.apply(user.getUidByUserslug, req.params.userslug), function(toUid, next) { - if (!toUid) { + if (!toUid || parseInt(toUid, 10) === parseInt(req.user.uid, 10)) { return helpers.notFound(req, res); } + async.parallel({ toUser: async.apply(user.getUserFields, toUid, ['uid', 'username']), messages: async.apply(messaging.getMessages, req.user.uid, toUid, 'recent', false),