aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <xmpp-dev@marcschink.de>2017-12-05 21:46:48 +0100
committerAndroid Development <you@example.com>2017-12-07 17:33:09 +0100
commit704a32ce965fb0aff11c38e67a06baaaf4e426a5 (patch)
tree7bd721d9809804991751d7225a26d278968d6a98
parent47620f242cf22a28449f184a9588540817c4c918 (diff)
XmppUri: Parse 'message' query
-rw-r--r--src/main/java/eu/siacs/conversations/utils/XmppUri.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/XmppUri.java b/src/main/java/eu/siacs/conversations/utils/XmppUri.java
index bfd4b7c..54f05f3 100644
--- a/src/main/java/eu/siacs/conversations/utils/XmppUri.java
+++ b/src/main/java/eu/siacs/conversations/utils/XmppUri.java
@@ -15,6 +15,7 @@ public class XmppUri {
protected String jid;
protected boolean muc;
+ protected boolean message;
protected List<Fingerprint> fingerprints = new ArrayList<>();
private String body;
protected boolean safeSource = true;
@@ -68,6 +69,7 @@ public class XmppUri {
} else if ("xmpp".equalsIgnoreCase(scheme)) {
// sample: xmpp:foo@bar.com
muc = isMuc(uri.getQuery());
+ message = isMessage(uri.getQuery());
if (uri.getAuthority() != null) {
jid = uri.getAuthority();
} else {
@@ -133,6 +135,16 @@ public class XmppUri {
return null;
}
+ protected boolean isMessage(String query) {
+ for(String pair : query == null ? new String[0] : query.split(";")) {
+ final String[] parts = pair.split("=", 2);
+ if (parts.length == 1 && "message".equals(parts[0])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
protected boolean isMuc(String query) {
for(String pair : query == null ? new String[0] : query.split(";")) {
final String[] parts = pair.split("=",2);