show warning when opening invalid jid
This commit is contained in:
parent
b5fe8789e9
commit
5885bc7f25
|
@ -1193,6 +1193,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);
|
||||
}
|
||||
|
|
|
@ -151,6 +151,15 @@ public class XmppUri {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isJidValid() {
|
||||
try {
|
||||
Jid.fromString(jid);
|
||||
return true;
|
||||
} catch (InvalidJidException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue