diff --git a/presentation/src/main/java/feature/compose/ComposeViewModel.kt b/presentation/src/main/java/feature/compose/ComposeViewModel.kt index 1c7b16c0..5af55169 100644 --- a/presentation/src/main/java/feature/compose/ComposeViewModel.kt +++ b/presentation/src/main/java/feature/compose/ComposeViewModel.kt @@ -59,6 +59,7 @@ import repository.ContactRepository import repository.MessageRepository import util.extensions.asObservable import java.net.URLDecoder +import java.util.* import java.util.concurrent.TimeUnit import javax.inject.Inject @@ -208,7 +209,8 @@ class ComposeViewModel(intent: Intent) : QkViewModel( // If the entry is a valid destination, allow it as a recipient if (PhoneNumberUtils.isWellFormedSmsAddress(query.toString())) { - val newContact = Contact(numbers = RealmList(PhoneNumber(address = query.toString()))) + val newAddress = PhoneNumberUtils.formatNumber(query.toString(), Locale.getDefault().country) + val newContact = Contact(numbers = RealmList(PhoneNumber(address = newAddress ?: query.toString()))) filteredContacts = listOf(newContact) + filteredContacts }