aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-05-05 20:58:36 +0200
committerChristian Schneppe <christian@pix-art.de>2018-05-05 20:58:36 +0200
commitda80d3b3863cf2c4e8226b728db95074f1226113 (patch)
tree703117205722d27187b3f6486f7e365cdce25e59 /src/main/java/de/pixart/messenger
parent6a4c366975dde87175b356084f2c258e782134e0 (diff)
XmppUri code cleanup
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/utils/XmppUri.java24
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", "%");
}