mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Fix duplicate e164 short codes cleanup bug.
This commit is contained in:
@@ -60,14 +60,14 @@ object SignalE164Util {
|
||||
* This does not check if the number is *valid* for a given region. Instead, it's very lenient and just
|
||||
* does it's best to interpret the input string as a number that could be put into the E164 format.
|
||||
*
|
||||
* Note that shortcodes will not have leading '+' signs.
|
||||
* Note that shortcodes will return null.
|
||||
*
|
||||
* In other words, if this method returns null, you likely do not have anything that could be considered
|
||||
* a phone number.
|
||||
*/
|
||||
@JvmStatic
|
||||
fun formatNonShortCodeAsE164(input: String): String? {
|
||||
return getFormatter().formatAsE164(input)?.takeIf { input.trimStart('+', '0').length > 6 }
|
||||
return getFormatter().formatAsE164(input)?.takeIf { !getFormatter().isValidShortNumber(input) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user