diff --git a/src/controllers/pages/MatrixChat.js b/src/controllers/pages/MatrixChat.js index 7c32a66d76..08cc652d9f 100644 --- a/src/controllers/pages/MatrixChat.js +++ b/src/controllers/pages/MatrixChat.js @@ -174,6 +174,19 @@ module.exports = { }); this.notifyNewScreen('room/'+allRooms[roomIndex].roomId); break; + case 'view_indexed_room': + var allRooms = RoomListSorter.mostRecentActivityFirst( + MatrixClientPeg.get().getRooms() + ); + var roomIndex = payload.roomIndex; + if (allRooms[roomIndex]) { + this.focusComposer = true; + this.setState({ + currentRoom: allRooms[roomIndex].roomId + }); + this.notifyNewScreen('room/'+allRooms[roomIndex].roomId); + } + break; case 'view_user_settings': this.setState({ page_type: this.PageTypes.UserSettings, @@ -247,6 +260,15 @@ module.exports = { onKeyDown: function(ev) { if (ev.altKey) { + if (ev.ctrlKey && ev.keyCode > 48 && ev.keyCode < 58) { + dis.dispatch({ + action: 'view_indexed_room', + roomIndex: ev.keyCode - 49, + }); + ev.stopPropagation(); + ev.preventDefault(); + return; + } switch (ev.keyCode) { case 38: dis.dispatch({action: 'view_prev_room'});