From b5ce1ac5e137bdf54be28bdbfce54f516f64dc91 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 6 Aug 2018 18:00:40 +0100 Subject: [PATCH] Recognise server notices room(s) and put them in their own section at the bottom --- src/components/views/rooms/RoomList.js | 14 +++++++++++++- src/i18n/strings/en_EN.json | 1 + src/stores/RoomListStore.js | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 8533e3f61a..ecc22b9a9f 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -35,7 +35,7 @@ import RoomListStore from '../../../stores/RoomListStore'; import GroupStore from '../../../stores/GroupStore'; const HIDE_CONFERENCE_CHANS = true; -const STANDARD_TAGS_REGEX = /^(m\.(favourite|lowpriority)|im\.vector\.fake\.(invite|recent|direct|archived))$/; +const STANDARD_TAGS_REGEX = /^(m\.(favourite|lowpriority|server_notice)|im\.vector\.fake\.(invite|recent|direct|archived))$/; function phraseForSection(section) { switch (section) { @@ -737,6 +737,18 @@ module.exports = React.createClass({ searchFilter={self.props.searchFilter} onShowMoreRooms={self.onShowMoreRooms} showEmpty={showEmpty} /> + + ); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 1605557a06..d44187b834 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -464,6 +464,7 @@ "People": "People", "Rooms": "Rooms", "Low priority": "Low priority", + "System Alerts": "System Alerts", "You have no historical rooms": "You have no historical rooms", "Historical": "Historical", "Unable to ascertain that the address this invite was sent to matches one associated with your account.": "Unable to ascertain that the address this invite was sent to matches one associated with your account.", diff --git a/src/stores/RoomListStore.js b/src/stores/RoomListStore.js index b6d0949dd3..f8f7e3e5d6 100644 --- a/src/stores/RoomListStore.js +++ b/src/stores/RoomListStore.js @@ -45,6 +45,7 @@ class RoomListStore extends Store { // Initialise state this._state = { lists: { + "m.server_notice": [], "im.vector.fake.invite": [], "m.favourite": [], "im.vector.fake.recent": [], @@ -158,6 +159,7 @@ class RoomListStore extends Store { _generateRoomLists(optimisticRequest) { const lists = { + "m.server_notice": [], "im.vector.fake.invite": [], "m.favourite": [], "im.vector.fake.recent": [],