+
+ { expandButton }
+
+
+
+
+
+
+
+ { Object.keys(self.state.lists).map(function(tagName) {
+ if (!tagName.match(/^m\.(invite|favourite|recent|lowpriority|archived)$/)) {
+ return
+
+ }
+ }) }
+
+
+
+
+
+
+ );
+ }
+});
\ No newline at end of file
diff --git a/src/controllers/organisms/RoomList.js b/src/controllers/organisms/RoomList.js
deleted file mode 100644
index 6b5a4c4722..0000000000
--- a/src/controllers/organisms/RoomList.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-Copyright 2015 OpenMarket Ltd
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-'use strict';
-
-var React = require("react");
-var MatrixClientPeg = require("../../MatrixClientPeg");
-var RoomListSorter = require("../../RoomListSorter");
-
-var sdk = require('../../index');
-
-module.exports = {
- componentWillMount: function() {
- var cli = MatrixClientPeg.get();
- cli.on("Room", this.onRoom);
- cli.on("Room.timeline", this.onRoomTimeline);
- cli.on("Room.name", this.onRoomName);
- cli.on("RoomState.events", this.onRoomStateEvents);
- cli.on("RoomMember.name", this.onRoomMemberName);
-
- var rooms = this.getRoomList();
- this.setState({
- roomList: rooms,
- activityMap: {}
- });
- },
-
- componentWillUnmount: function() {
- if (MatrixClientPeg.get()) {
- MatrixClientPeg.get().removeListener("Room", this.onRoom);
- MatrixClientPeg.get().removeListener("Room.timeline", this.onRoomTimeline);
- MatrixClientPeg.get().removeListener("Room.name", this.onRoomName);
- }
- },
-
- componentWillReceiveProps: function(newProps) {
- this.state.activityMap[newProps.selectedRoom] = undefined;
- this.setState({
- activityMap: this.state.activityMap
- });
- },
-
- onRoom: function(room) {
- this.refreshRoomList();
- },
-
- onRoomTimeline: function(ev, room, toStartOfTimeline) {
- if (toStartOfTimeline) return;
-
- var newState = {
- roomList: this.getRoomList()
- };
- if (
- room.roomId != this.props.selectedRoom &&
- ev.getSender() != MatrixClientPeg.get().credentials.userId)
- {
- var hl = 1;
-
- var actions = MatrixClientPeg.get().getPushActionsForEvent(ev);
- if (actions && actions.tweaks && actions.tweaks.highlight) {
- hl = 2;
- }
- // obviously this won't deep copy but this shouldn't be necessary
- var amap = this.state.activityMap;
- amap[room.roomId] = Math.max(amap[room.roomId] || 0, hl);
-
- newState.activityMap = amap;
- }
- this.setState(newState);
- },
-
- onRoomName: function(room) {
- this.refreshRoomList();
- },
-
- onRoomStateEvents: function(ev, state) {
- this.refreshRoomList();
- },
-
- onRoomMemberName: function(ev, member) {
- this.refreshRoomList();
- },
-
- refreshRoomList: function() {
- var rooms = this.getRoomList();
- this.setState({
- roomList: rooms
- });
- },
-
- getRoomList: function() {
- return RoomListSorter.mostRecentActivityFirst(
- MatrixClientPeg.get().getRooms().filter(function(room) {
- var member = room.getMember(MatrixClientPeg.get().credentials.userId);
- return member && (member.membership == "join" || member.membership == "invite");
- })
- );
- },
-
- makeRoomTiles: function() {
- var RoomTile = sdk.getComponent('molecules.RoomTile');
- var self = this;
- return this.state.roomList.map(function(room) {
- var selected = room.roomId == self.props.selectedRoom;
- return (
-