mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Do no apply filter in conversation when filter is empty
This commit is contained in:
parent
17d3208cbd
commit
b3396fa62e
1 changed files with 14 additions and 12 deletions
|
|
@ -333,20 +333,22 @@ class ConversationViewModel @UiThread constructor() : ViewModel() {
|
|||
val eventsList = arrayListOf<EventLogModel>()
|
||||
val groupedEventLogs = arrayListOf<EventLog>()
|
||||
for (event in history) {
|
||||
// TODO: let the SDK do it
|
||||
if (event.type == EventLog.Type.ConferenceChatMessage) {
|
||||
val message = event.chatMessage ?: continue
|
||||
val fromAddress = message.fromAddress
|
||||
val model = getAvatarModelForAddress(fromAddress)
|
||||
if (
|
||||
!model.name.value.orEmpty().contains(filter, ignoreCase = true) &&
|
||||
!fromAddress.asStringUriOnly().contains(filter, ignoreCase = true) &&
|
||||
!message.utf8Text.orEmpty().contains(filter, ignoreCase = true)
|
||||
) {
|
||||
if (filter.isNotEmpty()) {
|
||||
// TODO: let the SDK do it
|
||||
if (event.type == EventLog.Type.ConferenceChatMessage) {
|
||||
val message = event.chatMessage ?: continue
|
||||
val fromAddress = message.fromAddress
|
||||
val model = getAvatarModelForAddress(fromAddress)
|
||||
if (
|
||||
!model.name.value.orEmpty().contains(filter, ignoreCase = true) &&
|
||||
!fromAddress.asStringUriOnly().contains(filter, ignoreCase = true) &&
|
||||
!message.utf8Text.orEmpty().contains(filter, ignoreCase = true)
|
||||
) {
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
|
||||
if (groupedEventLogs.isEmpty()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue