From 5e0bfb2a9f96f4d30b64ab90e5c844f41afc9121 Mon Sep 17 00:00:00 2001 From: DerpgonCz Date: Thu, 23 Jun 2016 21:07:54 +0200 Subject: [PATCH] Banned users and guests no longer see last chat Fixes #96 --- socketserver/socketserver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/socketserver/socketserver.js b/socketserver/socketserver.js index 48e3eb3..d3b1b3d 100644 --- a/socketserver/socketserver.js +++ b/socketserver/socketserver.js @@ -667,7 +667,7 @@ var SocketServer = function(server){ roles: Roles.makeClientObj(), roleOrder: Roles.getOrder(), staffRoles: Roles.getStaffRoles(), - lastChat: that.room.makePrevChatObj(), + lastChat: ((!socket.user && !config.room.guestCanSeeChat) || (that.room.isUserRestricted((socket.user || {}).uid, 'BAN') && !config.room.bannedCanSeeChat)) ? [] : that.room.makePrevChatObj(), time: new Date().getTime(), captchakey: config.apis.reCaptcha.key, allowemojis: config.room.allowemojis,