From dee8ce81866d6fed80259ce95044aa9040e8ea8a Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 2 May 2023 18:18:12 -0500 Subject: [PATCH] Comment why weird concat here --- shared/viewmodels/RoomDirectoryViewModel.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/viewmodels/RoomDirectoryViewModel.js b/shared/viewmodels/RoomDirectoryViewModel.js index a908241..21be2b3 100644 --- a/shared/viewmodels/RoomDirectoryViewModel.js +++ b/shared/viewmodels/RoomDirectoryViewModel.js @@ -265,6 +265,8 @@ class RoomDirectoryViewModel extends ViewModel { if (safeSearchEnabled) { this._roomCardViewModelsFilterMap.setApply((roomId, vm) => { + // We concat the name, topic, etc together to simply do a single check against + // all of the text. const isNsfw = NSFW_REGEXES.some((regex) => regex.test(vm.name + ' ---- ' + vm.canonicalAlias + ' --- ' + vm.topic) );