Bug Fix - Use contains_url filter for navigating files and showing a file index for a room

#652

Support file search at room level.
This commit is contained in:
giomfo
2016-10-06 10:56:52 +02:00
parent ec4c4b4bf5
commit 6b4b0e816a
4 changed files with 46 additions and 35 deletions
@@ -139,9 +139,10 @@
messagesSearchDataSource = [[RoomSearchDataSource alloc] initWithRoomDataSource:_roomDataSource];
[messagesSearchViewController displaySearch:messagesSearchDataSource];
// Init the search for messages
filesSearchDataSource = [[MXKSearchDataSource alloc] initWithRoomId:_roomDataSource.roomId andMatrixSession:mainSession];
filesSearchDataSource.mediaFilter = MXMessagesSearchMediaFilterLimitedToAttachments;
// Init the search for attachments
filesSearchDataSource = [[MXKSearchDataSource alloc] initWithMatrixSession:mainSession];
filesSearchDataSource.roomEventFilter.rooms = @[_roomDataSource.roomId];
filesSearchDataSource.roomEventFilter.containsURL = YES;
filesSearchDataSource.shouldShowRoomDisplayName = NO;
[filesSearchDataSource registerCellDataClass:FilesSearchCellData.class forCellIdentifier:kMXKSearchCellDataIdentifier];
[filesSearchViewController displaySearch:filesSearchDataSource];