From eb6fbe6a5a6f7a67af512714cb78261b61f35af9 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 29 Oct 2015 02:24:35 +0000 Subject: [PATCH] theoretically scope the search, but it doesn't work --- src/controllers/organisms/RoomView.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index 1824f7fd65..df820d741a 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -360,12 +360,26 @@ module.exports = { }, onSearch: function(term, scope) { + var filter; + if (scope === "Room") { // FIXME: should be enum + filter = { + room: { + timeline: { + rooms: [ + this.props.roomId + ] + } + } + }; + } + var self = this; MatrixClientPeg.get().search({ body: { search_categories: { room_events: { search_term: term, + filter: filter, event_context: { before_limit: 1, after_limit: 1, @@ -411,7 +425,7 @@ module.exports = { var mxEv2 = new Matrix.MatrixEvent(resultList[i].context.events_after[0]); ret.push(
  • ); } - } + } return ret; }