From 1aa520b7a05af7e463cf3e83bf14dbd9a4cfb440 Mon Sep 17 00:00:00 2001 From: uplift Date: Tue, 22 Oct 2019 17:07:53 +0100 Subject: [PATCH] parseInt uid in room users check (#7988) nodebb-write-api fails this check without parsing into an int --- src/messaging/rooms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/messaging/rooms.js b/src/messaging/rooms.js index eea437f200..f2c93b18bc 100644 --- a/src/messaging/rooms.js +++ b/src/messaging/rooms.js @@ -224,7 +224,7 @@ module.exports = function (Messaging) { room.messages = messages; room.isOwner = parseInt(room.owner, 10) === parseInt(uid, 10); room.users = users.filter(function (user) { - return user && parseInt(user.uid, 10) && parseInt(user.uid, 10) !== uid; + return user && parseInt(user.uid, 10) && parseInt(user.uid, 10) !== parseInt(uid, 10); }); room.canReply = canReply; room.groupChat = room.hasOwnProperty('groupChat') ? room.groupChat : users.length > 2;