filter out messages where every participant is blocked, or somehow invalid

This commit is contained in:
tibbi 2020-04-11 15:41:06 +02:00
parent e0052d5516
commit 6544351480
2 changed files with 2 additions and 1 deletions

View File

@ -36,7 +36,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.25.4'
implementation 'com.simplemobiletools:commons:5.25.6'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.klinkerapps:android-smsmms:5.2.6'

View File

@ -95,6 +95,7 @@ fun Context.getMessages(threadId: Int? = null): ArrayList<Message> {
}
messages = messages.filter { !isNumberBlocked(it.participants.firstOrNull()?.phoneNumber ?: "") }.toMutableList() as ArrayList<Message>
messages = messages.filter { it.participants.isNotEmpty() }.toMutableList() as ArrayList<Message>
return messages
}