Merge pull request #2112 from matrix-org/dbkr/recognise_server_notices_room

Recognise server notices room(s)
This commit is contained in:
David Baker 2018-08-07 09:52:25 +01:00 committed by GitHub
commit f44cc8e66e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View file

@ -35,7 +35,7 @@ import RoomListStore from '../../../stores/RoomListStore';
import GroupStore from '../../../stores/GroupStore'; import GroupStore from '../../../stores/GroupStore';
const HIDE_CONFERENCE_CHANS = true; 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 labelForTagName(tagName) { function labelForTagName(tagName) {
if (tagName.startsWith('u.')) return tagName.slice(2); if (tagName.startsWith('u.')) return tagName.slice(2);
@ -742,6 +742,18 @@ module.exports = React.createClass({
searchFilter={self.props.searchFilter} searchFilter={self.props.searchFilter}
onShowMoreRooms={self.onShowMoreRooms} onShowMoreRooms={self.onShowMoreRooms}
showEmpty={showEmpty} /> showEmpty={showEmpty} />
<RoomSubList list={self.state.lists['m.server_notice']}
label={_t('System Alerts')}
tagName="m.lowpriority"
editable={false}
order="recent"
incomingCall={self.state.incomingCall}
collapsed={self.props.collapsed}
searchFilter={self.props.searchFilter}
onHeaderClick={self.onSubListHeaderClick}
onShowMoreRooms={self.onShowMoreRooms}
showEmpty={false} />
</div> </div>
</GeminiScrollbarWrapper> </GeminiScrollbarWrapper>
); );

View file

@ -464,6 +464,7 @@
"People": "People", "People": "People",
"Rooms": "Rooms", "Rooms": "Rooms",
"Low priority": "Low priority", "Low priority": "Low priority",
"System Alerts": "System Alerts",
"You have no historical rooms": "You have no historical rooms", "You have no historical rooms": "You have no historical rooms",
"Historical": "Historical", "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.", "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.",

View file

@ -45,6 +45,7 @@ class RoomListStore extends Store {
// Initialise state // Initialise state
this._state = { this._state = {
lists: { lists: {
"m.server_notice": [],
"im.vector.fake.invite": [], "im.vector.fake.invite": [],
"m.favourite": [], "m.favourite": [],
"im.vector.fake.recent": [], "im.vector.fake.recent": [],
@ -158,6 +159,7 @@ class RoomListStore extends Store {
_generateRoomLists(optimisticRequest) { _generateRoomLists(optimisticRequest) {
const lists = { const lists = {
"m.server_notice": [],
"im.vector.fake.invite": [], "im.vector.fake.invite": [],
"m.favourite": [], "m.favourite": [],
"im.vector.fake.recent": [], "im.vector.fake.recent": [],