From bfef3b3d3161fc2e6d4388581c31743bd9eb3ec6 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Sun, 12 Jun 2016 20:23:30 -0400 Subject: [PATCH] Make |unlink|hide| always roomhide |unlink|hide| used to hide all text from the user everywhere, not just in the room. While a good idea in spirit, in practice it was inconsistent in terms of what it hid, because not all users are in the same room, etc etc. It also made for very confusing behavior when text would disappear without a message, when a user was locked in a different room. This also fixes bugs caused by this behavior. --- js/client-chat.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/client-chat.js b/js/client-chat.js index b3a189337..ffe6fda05 100644 --- a/js/client-chat.js +++ b/js/client-chat.js @@ -1224,10 +1224,11 @@ if (!$messages.length) break; $messages.find('a').contents().unwrap(); if (row[2]) { - if (row[1] === 'roomhide') { - $messages = this.$chat.find('.chatmessage-' + user); - if (!$messages.length) break; - } + // there used to be a condition for + // row[1] === 'roomhide' + // but it's now always applied + $messages = this.$chat.find('.chatmessage-' + user); + if (!$messages.length) break; $messages.hide().addClass('revealed').find('button').parent().remove(); this.$chat.children().last().append(' '); } @@ -1251,7 +1252,7 @@ } }, toggleMessages: function (user, button) { - var $messages = $('.chatmessage-' + user + '.revealed'); + var $messages = this.$('.chatmessage-' + user + '.revealed'); var $button = $(button); if (!$messages.is(':hidden')) { $messages.hide();