improve the way blocked numbers are checked

This commit is contained in:
tibbi 2020-04-08 14:00:15 +02:00
parent 88389a09c9
commit f01bbb893e
2 changed files with 3 additions and 2 deletions

View File

@ -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'
} }

View File

@ -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)
} }