do not show blocked number messages on the main screen
This commit is contained in:
parent
bed5a80ccf
commit
88389a09c9
|
@ -90,6 +90,7 @@ fun Context.getMessages(threadId: Int? = null): ArrayList<Message> {
|
|||
messages = messages.distinctBy { it.thread }.toMutableList() as ArrayList<Message>
|
||||
}
|
||||
|
||||
messages = messages.filter { !isNumberBlocked(it.senderNumber) }.toMutableList() as ArrayList<Message>
|
||||
return messages
|
||||
}
|
||||
|
||||
|
@ -470,3 +471,8 @@ fun Context.getThreadId(address: String): Long {
|
|||
0
|
||||
}
|
||||
}
|
||||
|
||||
fun Context.isNumberBlocked(number: String): Boolean {
|
||||
val blockedNumbers = getBlockedNumbers()
|
||||
return blockedNumbers.map { it.number }.contains(number) && !blockedNumbers.map { it.normalizedNumber }.contains(number)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue