Room message search : the search pattern is not highlighted in results

#660
This commit is contained in:
giomfo
2016-09-28 13:26:06 +02:00
parent d73cbff445
commit e8357ec5d0
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -18,6 +18,8 @@
#import "RoomBubbleCellData.h"
#import "VectorDesignValues.h"
#import "MXKRoomBubbleTableViewCell+Vector.h"
@interface RoomSearchDataSource ()
@@ -48,6 +50,9 @@
- (void)convertHomeserverResultsIntoCells:(MXSearchRoomEventResults *)roomEventResults
{
// Prepare text font used to highlight the search pattern.
UIFont *patternFont = [roomDataSource.eventFormatter bingTextFont];
// Convert the HS results into `RoomViewController` cells
for (MXSearchResult *result in roomEventResults.results)
{
@@ -58,6 +63,9 @@
RoomBubbleCellData *cellData = [[RoomBubbleCellData alloc] initWithEvent:result.result andRoomState:roomDataSource.room.state andRoomDataSource:roomDataSource];
if (cellData)
{
// Highlight the search pattern
[cellData highlightPatternInTextMessage:self.searchText withForegroundColor:kVectorColorGreen andFont:patternFont];
[cellDataArray insertObject:cellData atIndex:0];
}
}