Skip to content

Node.js based forum software built for the modern web

closes #2619

Barış Soner Uşaklı3f31098144c2
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),