This commit is contained in:
Barış Soner Uşaklı
2015-02-11 16:16:32 -05:00
parent 3293436867
commit 3f31098144

View File

@@ -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),