Fix short code check!
It was returning true when it should return false Broke it while trying to fix https://github.com/FossifyOrg/Messages/issues/115
This commit is contained in:
parent
b920dbd482
commit
f0ef2bfe10
1 changed files with 4 additions and 5 deletions
|
|
@ -102,11 +102,10 @@ fun Context.sendMessageCompat(
|
|||
* contains outdated information regarding max number of digits. The exact parameters for short codes can vary by country and by carrier.
|
||||
*/
|
||||
fun isShortCodeWithLetters(address: String): Boolean {
|
||||
val hasLetters = address.any { it.isLetter() }
|
||||
return if (hasLetters) {
|
||||
if (Patterns.EMAIL_ADDRESS.matcher(address).matches()) {
|
||||
// emails are not short codes: https://github.com/FossifyOrg/Messages/issues/115
|
||||
!Patterns.EMAIL_ADDRESS.matcher(address).matches()
|
||||
} else {
|
||||
true
|
||||
return false
|
||||
}
|
||||
|
||||
return address.any { it.isLetter() }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue