diff --git a/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m b/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m index 5a332ed5f..83bf82ed4 100644 --- a/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m +++ b/Riot/Modules/GlobalSearch/Messages/DataSources/HomeMessagesSearchDataSource.m @@ -67,6 +67,11 @@ // Highlight the search pattern [cellData highlightPatternInTextMessage:self.searchText withForegroundColor:kRiotColorGreen andFont:patternFont]; + // Use profile information as data to display + MXSearchUserProfile *userProfile = result.context.profileInfo[result.result.sender]; + cellData.senderDisplayName = userProfile.displayName; + cellData.senderAvatarUrl = userProfile.avatarUrl; + [self->cellDataArray insertObject:cellData atIndex:0]; } } diff --git a/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m b/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m index a375117db..94503a882 100644 --- a/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m +++ b/Riot/Modules/Room/Search/DataSources/RoomSearchDataSource.m @@ -69,7 +69,12 @@ { // Highlight the search pattern [cellData highlightPatternInTextMessage:self.searchText withForegroundColor:kRiotColorGreen andFont:patternFont]; - + + // Use profile information as data to display + MXSearchUserProfile *userProfile = result.context.profileInfo[result.result.sender]; + cellData.senderDisplayName = userProfile.displayName; + cellData.senderAvatarUrl = userProfile.avatarUrl; + [cellDataArray insertObject:cellData atIndex:0]; } }