diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-12-18 21:43:27 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-12-18 21:43:27 +0100 |
commit | ba4184b633b33d03bd40ea7ea7495567f95c8a46 (patch) | |
tree | 2185d19ad17728f2a6f95c039a473fa76e8e8393 /src/main/java/de/pixart/messenger/entities | |
parent | 09b3ffd482251ce7ef2031f445d81879e22cfa93 (diff) |
add omemo fingerprints to web links as well
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Account.java | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Account.java b/src/main/java/de/pixart/messenger/entities/Account.java index d2295e2db..2642845b6 100644 --- a/src/main/java/de/pixart/messenger/entities/Account.java +++ b/src/main/java/de/pixart/messenger/entities/Account.java @@ -21,6 +21,7 @@ import java.util.Locale; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; +import de.pixart.messenger.Config; import de.pixart.messenger.R; import de.pixart.messenger.crypto.OtrService; import de.pixart.messenger.crypto.PgpDecryptionService; @@ -610,23 +611,16 @@ public class Account extends AbstractEntity { List<XmppUri.Fingerprint> fingerprints = this.getFingerprints(); String uri = "xmpp:" + this.getJid().toBareJid().toString(); if (fingerprints.size() > 0) { - StringBuilder builder = new StringBuilder(uri); - builder.append('?'); - for (int i = 0; i < fingerprints.size(); ++i) { - XmppUri.FingerprintType type = fingerprints.get(i).type; - if (type == XmppUri.FingerprintType.OMEMO) { - builder.append(XmppUri.OMEMO_URI_PARAM); - builder.append(fingerprints.get(i).deviceId); - } else if (type == XmppUri.FingerprintType.OTR) { - builder.append(XmppUri.OTR_URI_PARAM); - } - builder.append('='); - builder.append(fingerprints.get(i).fingerprint); - if (i != fingerprints.size() - 1) { - builder.append(';'); - } - } - return builder.toString(); + return XmppUri.getFingerprintUri(uri,fingerprints,';'); + } else { + return uri; + } + } + public String getShareableLink() { + List<XmppUri.Fingerprint> fingerprints = this.getFingerprints(); + String uri = Config.inviteUserURL+this.getJid().toBareJid().toString(); + if (fingerprints.size() > 0) { + return XmppUri.getFingerprintUri(uri,fingerprints,'&'); } else { return uri; } |