parseInt uid in room users check (#7988)

nodebb-write-api fails this check without parsing into an int
v1.18.x
uplift 5 years ago committed by Barış Soner Uşaklı
parent 500ca6658e
commit 1aa520b7a0

@ -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;

Loading…
Cancel
Save