diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index daa429d79f..5f1ce2284d 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -618,7 +618,17 @@ module.exports = React.createClass({ if (this.state.searchScope === 'All') { var roomId = mxEv.getRoomId(); if(roomId != lastRoomId) { - ret.push(
  • Room: { cli.getRoom(roomId).name }

  • ); + var room = cli.getRoom(roomId); + + // XXX: if we've left the room, we might not know about + // it. We should tell the js sdk to go and find out about + // it. But that's not an issue currently, as synapse only + // returns results for rooms we're joined to. + var roomName = room ? room.name : "Unknown room "+roomId; + + ret.push(
  • +

    Room: { roomName }

    +
  • ); lastRoomId = roomId; } } diff --git a/src/components/views/rooms/SearchResultTile.js b/src/components/views/rooms/SearchResultTile.js index 73ed74b169..9d3af16ee7 100644 --- a/src/components/views/rooms/SearchResultTile.js +++ b/src/components/views/rooms/SearchResultTile.js @@ -23,9 +23,14 @@ module.exports = React.createClass({ displayName: 'SearchResult', propTypes: { + // a matrix-js-sdk SearchResult containing the details of this result searchResult: React.PropTypes.object.isRequired, + + // a list of strings to be highlighted in the results searchHighlights: React.PropTypes.array, - onClick: React.PropTypes.func, + + // callback to be called when the user selects this result + onSelect: React.PropTypes.func, }, render: function() { @@ -48,7 +53,7 @@ module.exports = React.createClass({ } if (EventTile.haveTileForEvent(ev)) { ret.push() + onHighlightClick={this.props.onSelect}/>) } } return (