diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/StartConversationActivity.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/XmppUri.java | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java index 642296c31..23a0bf011 100644 --- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java @@ -1192,6 +1192,10 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU public String account; boolean invite() { + if (!isJidValid()) { + Toast.makeText(StartConversationActivity.this, R.string.invalid_jid, Toast.LENGTH_SHORT).show(); + return false; + } if (getJid() != null) { return handleJid(this); } diff --git a/src/main/java/de/pixart/messenger/utils/XmppUri.java b/src/main/java/de/pixart/messenger/utils/XmppUri.java index 120f0e88a..24c0b3bff 100644 --- a/src/main/java/de/pixart/messenger/utils/XmppUri.java +++ b/src/main/java/de/pixart/messenger/utils/XmppUri.java @@ -156,6 +156,15 @@ public class XmppUri { } } + public boolean isJidValid() { + try { + Jid.fromString(jid); + return true; + } catch (InvalidJidException e) { + return false; + } + } + public String getBody() { return body; } |