aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-07 23:32:24 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-07 23:32:24 +0200
commitdb59b15ed94eaebe6932d7bc9eaceadf9bc1a4f3 (patch)
tree0ac757efee9c80754bf4fd0401f73688bd5e4379 /src/main/java/de/pixart/messenger
parent903a3d17f2055bdc5ba4f316419b158ce453bfda (diff)
use escaped form of jid where approriate
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Account.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/stanzas/AbstractStanza.java8
4 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Account.java b/src/main/java/de/pixart/messenger/entities/Account.java
index 8d750bf5c..222e33b3b 100644
--- a/src/main/java/de/pixart/messenger/entities/Account.java
+++ b/src/main/java/de/pixart/messenger/entities/Account.java
@@ -653,7 +653,7 @@ public class Account extends AbstractEntity {
public String getShareableUri() {
List<XmppUri.Fingerprint> fingerprints = this.getFingerprints();
- String uri = "xmpp:" + this.getJid().asBareJid().toString();
+ String uri = "xmpp:" + this.getJid().asBareJid().toEscapedString();
if (fingerprints.size() > 0) {
return XmppUri.getFingerprintUri(uri,fingerprints,';');
} else {
@@ -662,7 +662,7 @@ public class Account extends AbstractEntity {
}
public String getShareableLink() {
List<XmppUri.Fingerprint> fingerprints = this.getFingerprints();
- String uri = Config.inviteUserURL+this.getJid().asBareJid().toString();
+ String uri = Config.inviteUserURL + this.getJid().asBareJid().toEscapedString();
if (fingerprints.size() > 0) {
return XmppUri.getFingerprintUri(uri,fingerprints,'&');
} else {
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java
index dae489e18..cbcd573b9 100644
--- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java
@@ -374,9 +374,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
protected String getShareableUri(boolean http) {
if (mConversation != null) {
if (http) {
- return Config.inviteMUCURL + mConversation.getJid().asBareJid();
+ return Config.inviteMUCURL + mConversation.getJid().asBareJid().toEscapedString();
} else {
- return "xmpp:" + mConversation.getJid().asBareJid() + "?join";
+ return "xmpp:" + mConversation.getJid().asBareJid().toEscapedString() + "?join";
}
} else {
return null;
diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
index 4726922bf..ce4dad47e 100644
--- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
@@ -231,7 +231,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
protected String getShareableUri(boolean http) {
final String prefix = http ? Config.inviteUserURL : "xmpp:";
if (contact != null) {
- return prefix + contact.getJid().asBareJid().toString();
+ return prefix + contact.getJid().asBareJid().toEscapedString();
} else {
return "";
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/stanzas/AbstractStanza.java b/src/main/java/de/pixart/messenger/xmpp/stanzas/AbstractStanza.java
index 9e26439c2..58d2a8b68 100644
--- a/src/main/java/de/pixart/messenger/xmpp/stanzas/AbstractStanza.java
+++ b/src/main/java/de/pixart/messenger/xmpp/stanzas/AbstractStanza.java
@@ -20,26 +20,26 @@ public class AbstractStanza extends Element {
public void setTo(final Jid to) {
if (to != null) {
- setAttribute("to", to.toString());
+ setAttribute("to", to.toEscapedString());
}
}
public void setFrom(final Jid from) {
if (from != null) {
- setAttribute("from", from.toString());
+ setAttribute("from", from.toEscapedString());
}
}
public boolean fromServer(final Account account) {
return getFrom() == null
- || getFrom().equals(account.getServer())
+ || getFrom().equals(Jid.of(account.getServer()))
|| getFrom().equals(account.getJid().asBareJid())
|| getFrom().equals(account.getJid());
}
public boolean toServer(final Account account) {
return getTo() == null
- || getTo().equals(account.getServer())
+ || getTo().equals(Jid.of(account.getServer()))
|| getTo().equals(account.getJid().asBareJid())
|| getTo().equals(account.getJid());
}