Browse Source

in message cells highlights were off - fixed

nayooti 5 years ago
parent
commit
5124070e4e
1 changed files with 4 additions and 6 deletions
  1. 4 6
      deltachat-ios/ViewModel/ChatListViewModel.swift

+ 4 - 6
deltachat-ios/ViewModel/ChatListViewModel.swift

@@ -248,18 +248,16 @@ extension ChatListViewModel: UISearchResultsUpdating {
             let summary: DcLot = msg.summary(chat: chat)
             let unreadMessages = getUnreadMessages(chatId: chatId)
 
-            let messageTitleHighlights = summary.text1?.containsExact(subSequence: searchText) ?? []
-            let messageHighlights = summary.text2?.containsExact(subSequence: searchText) ?? []
-
             let viewModel = ChatCellViewModel(
                 chatData: ChatCellData(
                     chatId: chatId,
                     summary: summary,
                     unreadMessages: unreadMessages
-                ),
-                titleHighlightIndexes: messageTitleHighlights,
-                subtitleHighlightIndexes: messageHighlights
+                )
             )
+            let subtitle = viewModel.subtitle
+            viewModel.subtitleHighlightIndexes = subtitle.containsExact(subSequence: searchText)
+
             filteredMessageCellViewModels.append(viewModel)
         }
         filteredMessages.cellData = filteredMessageCellViewModels