trim white spece from new account and callee

This commit is contained in:
Juha Heinanen
2018-07-30 13:15:48 +03:00
parent 59d22b12ab
commit 0c3ed43539
2 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class AccountsActivity : AppCompatActivity() {
val addAccountButton = findViewById(R.id.addAccount) as ImageButton
val newAorView = findViewById(R.id.newAor) as EditText
addAccountButton.setOnClickListener{
var aor = newAorView.text.toString()
var aor = newAorView.text.toString().trim()
if (!aor.startsWith("sip:")) aor = "sip:$aor"
if (!checkSipUri(aor)) {
Log.e("Baresip", "Invalid SIP URI $aor")

View File

@ -237,6 +237,7 @@ class MainActivity : AppCompatActivity() {
"Call" -> {
if (!ONE_CALL_ONLY || calls.isEmpty()) {
val calleeText = (findViewById(R.id.callee) as EditText).text.toString()
.trim()
if (calleeText.length > 0) {
var uri = ContactsActivity.findContactURI(calleeText)
if (!uri.startsWith("sip:")) uri = "sip:$uri"