improve the way blocked numbers are checked
This commit is contained in:
parent
88389a09c9
commit
f01bbb893e
|
@ -36,7 +36,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.25.1'
|
implementation 'com.simplemobiletools:commons:5.25.2'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
|
||||||
implementation 'org.greenrobot:eventbus:3.2.0'
|
implementation 'org.greenrobot:eventbus:3.2.0'
|
||||||
}
|
}
|
||||||
|
|
|
@ -474,5 +474,6 @@ fun Context.getThreadId(address: String): Long {
|
||||||
|
|
||||||
fun Context.isNumberBlocked(number: String): Boolean {
|
fun Context.isNumberBlocked(number: String): Boolean {
|
||||||
val blockedNumbers = getBlockedNumbers()
|
val blockedNumbers = getBlockedNumbers()
|
||||||
return blockedNumbers.map { it.number }.contains(number) && !blockedNumbers.map { it.normalizedNumber }.contains(number)
|
val numberToCompare = number.trimToComparableNumber()
|
||||||
|
return blockedNumbers.map { it.numberToCompare }.contains(numberToCompare)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue