mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-18 03:48:08 +00:00
Trim string before making a new call or creating a chat room
This commit is contained in:
parent
ee40995f34
commit
59bcb63dee
2 changed files with 3 additions and 3 deletions
|
|
@ -83,7 +83,7 @@ open class ContactsSelectionViewModel : MessageNotifierViewModel() {
|
|||
}
|
||||
|
||||
fun applyFilter() {
|
||||
val filterValue = filter.value.orEmpty()
|
||||
val filterValue = filter.value.orEmpty().trim()
|
||||
|
||||
if (previousFilter.isNotEmpty() && (
|
||||
previousFilter.length > filterValue.length ||
|
||||
|
|
@ -97,7 +97,7 @@ open class ContactsSelectionViewModel : MessageNotifierViewModel() {
|
|||
val domain = if (sipContactsSelected.value == true) coreContext.core.defaultAccount?.params?.domain ?: "" else ""
|
||||
searchResultsPending = true
|
||||
fastFetchJob?.cancel()
|
||||
coreContext.contactsManager.magicSearch.getContactsListAsync(filter.value.orEmpty(), domain, MagicSearchSource.All.toInt(), MagicSearchAggregation.None)
|
||||
coreContext.contactsManager.magicSearch.getContactsListAsync(filterValue, domain, MagicSearchSource.All.toInt(), MagicSearchAggregation.None)
|
||||
|
||||
val spinnerDelay = corePreferences.delayBeforeShowingContactsSearchSpinner.toLong()
|
||||
fastFetchJob = viewModelScope.launch {
|
||||
|
|
|
|||
|
|
@ -647,7 +647,7 @@ class CoreContext(
|
|||
}
|
||||
|
||||
fun startCall(to: String) {
|
||||
var stringAddress = to
|
||||
var stringAddress = to.trim()
|
||||
if (android.util.Patterns.PHONE.matcher(to).matches()) {
|
||||
val contact = contactsManager.findContactByPhoneNumber(to)
|
||||
val alias = contact?.getContactForPhoneNumberOrAddress(to)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue