mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-20 18:28:32 +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() {
|
fun applyFilter() {
|
||||||
val filterValue = filter.value.orEmpty()
|
val filterValue = filter.value.orEmpty().trim()
|
||||||
|
|
||||||
if (previousFilter.isNotEmpty() && (
|
if (previousFilter.isNotEmpty() && (
|
||||||
previousFilter.length > filterValue.length ||
|
previousFilter.length > filterValue.length ||
|
||||||
|
|
@ -97,7 +97,7 @@ open class ContactsSelectionViewModel : MessageNotifierViewModel() {
|
||||||
val domain = if (sipContactsSelected.value == true) coreContext.core.defaultAccount?.params?.domain ?: "" else ""
|
val domain = if (sipContactsSelected.value == true) coreContext.core.defaultAccount?.params?.domain ?: "" else ""
|
||||||
searchResultsPending = true
|
searchResultsPending = true
|
||||||
fastFetchJob?.cancel()
|
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()
|
val spinnerDelay = corePreferences.delayBeforeShowingContactsSearchSpinner.toLong()
|
||||||
fastFetchJob = viewModelScope.launch {
|
fastFetchJob = viewModelScope.launch {
|
||||||
|
|
|
||||||
|
|
@ -647,7 +647,7 @@ class CoreContext(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startCall(to: String) {
|
fun startCall(to: String) {
|
||||||
var stringAddress = to
|
var stringAddress = to.trim()
|
||||||
if (android.util.Patterns.PHONE.matcher(to).matches()) {
|
if (android.util.Patterns.PHONE.matcher(to).matches()) {
|
||||||
val contact = contactsManager.findContactByPhoneNumber(to)
|
val contact = contactsManager.findContactByPhoneNumber(to)
|
||||||
val alias = contact?.getContactForPhoneNumberOrAddress(to)
|
val alias = contact?.getContactForPhoneNumberOrAddress(to)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue