From e59bc1feae396dfa5b5648e67a3369c2459a0960 Mon Sep 17 00:00:00 2001 From: Naveen Date: Sat, 7 Jan 2023 17:33:54 +0530 Subject: [PATCH] Remove length check --- .../simplemobiletools/smsmessenger/messaging/Messaging.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/messaging/Messaging.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/messaging/Messaging.kt index efd65efb..5a92c719 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/messaging/Messaging.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/messaging/Messaging.kt @@ -64,11 +64,8 @@ fun Context.sendMessageCompat(text: String, addresses: List, subId: Int? * There's not much info available on these special numbers, even the wikipedia page (https://en.wikipedia.org/wiki/Short_code) * contains outdated information regarding max number of digits. The exact parameters for short codes can vary by country and by carrier. * - * This function returns true if the [address] length is less than or equal to [maxLength] and contains at least one letter. + * This function simply returns true if the [address] contains at least one letter. */ -fun isShortCodeWithLetters(address: String, maxLength: Int = 10): Boolean { - if (address.length > maxLength) { - return false - } +fun isShortCodeWithLetters(address: String): Boolean { return address.any { it.isLetter() } }