diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/XmppUri.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/XmppUri.java b/src/main/java/de/pixart/messenger/utils/XmppUri.java index 04b9f1d93..23ec4efa4 100644 --- a/src/main/java/de/pixart/messenger/utils/XmppUri.java +++ b/src/main/java/de/pixart/messenger/utils/XmppUri.java @@ -17,13 +17,13 @@ public class XmppUri { protected Uri uri; protected String jid; protected String fingerprint; - protected List<Fingerprint> fingerprints = new ArrayList<>(); + private List<Fingerprint> fingerprints = new ArrayList<>(); private String body; private String name; private String action; - protected boolean safeSource = true; - public static final String OMEMO_URI_PARAM = "omemo-sid-"; - public static final String OTR_URI_PARAM = "otr-fingerprint"; + private boolean safeSource = true; + private static final String OMEMO_URI_PARAM = "omemo-sid-"; + private static final String OTR_URI_PARAM = "otr-fingerprint"; public static final String ACTION_JOIN = "join"; public static final String ACTION_MESSAGE = "message"; @@ -123,11 +123,11 @@ public class XmppUri { return ""; } - protected List<Fingerprint> parseFingerprints(String query) { + private List<Fingerprint> parseFingerprints(String query) { return parseFingerprints(query, ';'); } - protected List<Fingerprint> parseFingerprints(String query, char seperator) { + private List<Fingerprint> parseFingerprints(String query, char seperator) { List<Fingerprint> fingerprints = new ArrayList<>(); String[] pairs = query == null ? new String[0] : query.split(String.valueOf(seperator)); for (String pair : pairs) { @@ -151,7 +151,7 @@ public class XmppUri { return fingerprints; } - protected String parseParameter(String key, String query) { + private String parseParameter(String key, String query) { for (String pair : query == null ? new String[0] : query.split(";")) { final String[] parts = pair.split("=", 2); if (parts.length == 2 && key.equals(parts[0].toLowerCase(Locale.US))) { @@ -176,11 +176,7 @@ public class XmppUri { } public boolean isAction(final String action) { - if (this.action == null) { - return false; - } - - return this.action.equals(action); + return this.action != null && this.action.equals(action); } public Jid getJid() { @@ -247,7 +243,7 @@ public class XmppUri { public static class Fingerprint { public final FingerprintType type; public final String fingerprint; - public final int deviceId; + final int deviceId; public Fingerprint(FingerprintType type, String fingerprint) { this(type, fingerprint, 0); @@ -265,7 +261,7 @@ public class XmppUri { } } - public static String lameUrlDecode(String url) { + private static String lameUrlDecode(String url) { return url.replace("%23", "#").replace("%25", "%"); } |