From 8d56e097a584e1cb4235b618c93a8d93940e43d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 8 Jun 2024 20:50:46 -0400 Subject: [PATCH] fix: return early for guests/spiders they cant have private chats --- src/messaging/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/messaging/index.js b/src/messaging/index.js index ccedd47e81..7a2cd617a6 100644 --- a/src/messaging/index.js +++ b/src/messaging/index.js @@ -417,7 +417,8 @@ async function checkReputation(uid) { } Messaging.hasPrivateChat = async (uid, withUid) => { - if (parseInt(uid, 10) === parseInt(withUid, 10)) { + if (parseInt(uid, 10) === parseInt(withUid, 10) || + parseInt(uid, 10) <= 0 || parseInt(withUid, 10) <= 0) { return 0; }