From 63501adc45804ced79486fe7e7ff32213f38ef49 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 25 Nov 2022 08:50:58 +0100 Subject: [PATCH] trim xmpp address after user input --- src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java | 2 +- .../eu/siacs/conversations/ui/StartConversationActivity.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java b/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java index 15ebdb0b7..9ffd9c673 100644 --- a/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java +++ b/src/main/java/eu/siacs/conversations/ui/EnterJidDialog.java @@ -170,7 +170,7 @@ public class EnterJidDialog extends DialogFragment implements OnBackendConnected } final Jid contactJid; try { - contactJid = Jid.ofEscaped(binding.jid.getText().toString()); + contactJid = Jid.ofEscaped(binding.jid.getText().toString().trim()); } catch (final IllegalArgumentException e) { binding.jidLayout.setError(getActivity().getString(R.string.invalid_jid)); return; diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 91807295b..7a2ffc0d8 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -1054,7 +1054,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne if (account == null) { return; } - final String input = jid.getText().toString(); + final String input = jid.getText().toString().trim(); Jid conferenceJid; try { conferenceJid = Jid.ofEscaped(input);