From b2302af7080b8123e2076b3d439312a5acc51e36 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 6 Aug 2018 16:58:54 +0100 Subject: [PATCH] Update room tags behaviour to match spec more Fix Riot's behaviour with room tags after my cleanup in https://github.com/matrix-org/matrix-doc/pull/1457 . Although, reading it again, it's not clear how you're supposed to tell the difference between a reverse-dns tag name and a legacy freeform text tag (contains a '.'?) - I've left it detecting these as freeform text for now. --- src/components/views/rooms/RoomList.js | 7 ++++++- src/stores/RoomListStore.js | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 8533e3f61a..27f88fb33b 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -37,6 +37,11 @@ import GroupStore from '../../../stores/GroupStore'; const HIDE_CONFERENCE_CHANS = true; const STANDARD_TAGS_REGEX = /^(m\.(favourite|lowpriority)|im\.vector\.fake\.(invite|recent|direct|archived))$/; +function labelForTagName(tagName) { + if (tagName.startsWith('u.')) return tagName.slice(2); + return tagName; +} + function phraseForSection(section) { switch (section) { case 'm.favourite': @@ -690,7 +695,7 @@ module.exports = React.createClass({ if (!tagName.match(STANDARD_TAGS_REGEX)) { return { + return !t.startsWith('m.') || lists[t] !== undefined; + }); + if (tagNames.length) { for (let i = 0; i < tagNames.length; i++) { const tagName = tagNames[i];