aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-10-19 12:31:11 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-10-19 12:31:11 +0200
commitc3423d6ffe28bab55592ec0330b021918e042322 (patch)
tree631b7686c5f8c5402daeb3c2c52e8c9e259f62c2
parentdce8149aaec9b854853bc136eb6a9861885d4e8d (diff)
include pgp signature only in non anonymous mucs
-rw-r--r--src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java6
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java b/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
index f9fed914..f8639885 100644
--- a/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
+++ b/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
@@ -38,13 +38,17 @@ public class PresenceGenerator extends AbstractGenerator {
}
public PresencePacket selfPresence(Account account, Presence.Status status) {
+ return selfPresence(account, status, true);
+ }
+
+ public PresencePacket selfPresence(Account account, Presence.Status status, boolean includePgpAnnouncement) {
PresencePacket packet = new PresencePacket();
if(status.toShowString() != null) {
packet.addChild("show").setContent(status.toShowString());
}
packet.setFrom(account.getJid());
String sig = account.getPgpSignature();
- if (sig != null && mXmppConnectionService.getPgpEngine() != null) {
+ if (includePgpAnnouncement && sig != null && mXmppConnectionService.getPgpEngine() != null) {
packet.addChild("x", "jabber:x:signed").setContent(sig);
}
String capHash = getCapHash();
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index e96704f3..70b67563 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -2037,11 +2037,11 @@ public class XmppConnectionService extends Service {
final MucOptions mucOptions = conversation.getMucOptions();
final Jid joinJid = mucOptions.getSelf().getFullJid();
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": joining conversation " + joinJid.toString());
- PresencePacket packet = mPresenceGenerator.selfPresence(account, Presence.Status.ONLINE);
+ PresencePacket packet = mPresenceGenerator.selfPresence(account, Presence.Status.ONLINE, mucOptions.nonanonymous());
packet.setTo(joinJid);
Element x = packet.addChild("x", "http://jabber.org/protocol/muc");
if (conversation.getMucOptions().getPassword() != null) {
- x.addChild("password").setContent(conversation.getMucOptions().getPassword());
+ x.addChild("password").setContent(mucOptions.getPassword());
}
if (mucOptions.mamSupport()) {