diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-08-31 15:43:20 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-08-31 15:43:20 +0200 |
commit | cce36fcbb7834f731e5117981ef5f55f27ec11a2 (patch) | |
tree | 9373c6841116bc9006e87c324e2670da19070930 /src/main/java/de/pixart/messenger/generator/PresenceGenerator.java | |
parent | 24ca2a88fb1013a78d00fb6580853583bc6e7a7f (diff) |
include pgp sig and status in presence to non anon muc
Diffstat (limited to 'src/main/java/de/pixart/messenger/generator/PresenceGenerator.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/generator/PresenceGenerator.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/main/java/de/pixart/messenger/generator/PresenceGenerator.java b/src/main/java/de/pixart/messenger/generator/PresenceGenerator.java index b89783e07..02bd5b078 100644 --- a/src/main/java/de/pixart/messenger/generator/PresenceGenerator.java +++ b/src/main/java/de/pixart/messenger/generator/PresenceGenerator.java @@ -50,15 +50,20 @@ public class PresenceGenerator extends AbstractGenerator { 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()); - final String sig = account.getPgpSignature(); - if (includePgpAnnouncement && sig != null && mXmppConnectionService.getPgpEngine() != null) { - packet.addChild("x", "jabber:x:signed").setContent(sig); + public PresencePacket selfPresence(final Account account, final Presence.Status status, final boolean personal) { + final PresencePacket packet = new PresencePacket(); + if (personal) { + final String sig = account.getPgpSignature(); + final String message = account.getPresenceStatusMessage(); + if (status.toShowString() != null) { + packet.addChild("show").setContent(status.toShowString()); + } + if (!TextUtils.isEmpty(message)) { + packet.addChild(new Element("status").setContent(message)); + } + if (sig != null && mXmppConnectionService.getPgpEngine() != null) { + packet.addChild("x", "jabber:x:signed").setContent(sig); + } } final String capHash = getCapHash(account); if (capHash != null) { |