From 560b010a65cfee7d2b2768dca46c9c4c6c9e7800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 25 Mar 2020 23:01:20 +0100 Subject: [PATCH] Prevent the copy handler from unveiling tombstoned messages --- files_wcf/js/Bastelstu.be/Chat/Ui/MessageStream.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/files_wcf/js/Bastelstu.be/Chat/Ui/MessageStream.js b/files_wcf/js/Bastelstu.be/Chat/Ui/MessageStream.js index dafd4d1..9e502ea 100644 --- a/files_wcf/js/Bastelstu.be/Chat/Ui/MessageStream.js +++ b/files_wcf/js/Bastelstu.be/Chat/Ui/MessageStream.js @@ -1,10 +1,10 @@ /* - * Copyright (c) 2010-2018 Tim Düsterhus. + * Copyright (c) 2010-2020 Tim Düsterhus. * * Use of this software is governed by the Business Source License * included in the LICENSE file. * - * Change Date: 2022-11-27 + * Change Date: 2024-03-25 * * On the date above, in accordance with the Business Source * License, use of this software will be governed by version 2 @@ -14,11 +14,12 @@ define([ '../Helper' , 'WoltLabSuite/Core/Date/Util' , 'WoltLabSuite/Core/Dom/Change/Listener' + , 'WoltLabSuite/Core/Language' , 'WoltLabSuite/Core/User' , 'WoltLabSuite/Core/Dom/Traverse' , '../DataStructure/EventEmitter' , '../DataStructure/RedBlackTree/Tree' - ], function (Helper, DateUtil, DomChangeListener, User, DOMTraverse, EventEmitter, Tree) { + ], function (Helper, DateUtil, DomChangeListener, Language, User, DOMTraverse, EventEmitter, Tree) { "use strict"; const enableAutoscroll = Symbol('enableAutoscroll') @@ -315,6 +316,10 @@ define([ '../Helper' if (!message) return + if (el.classList.contains('tombstone')) { + return `[${message.formattedTime}] ${Language.get('chat.messageType.be.bastelstu.chat.messageType.tombstone.message')}` + } + const elem = elBySel('.chatMessage', el) let body