aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/generator/PresenceGenerator.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/generator/PresenceGenerator.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/generator/PresenceGenerator.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/generator/PresenceGenerator.java b/src/main/java/de/thedevstack/conversationsplus/generator/PresenceGenerator.java
index 1656bd51..f370c6e0 100644
--- a/src/main/java/de/thedevstack/conversationsplus/generator/PresenceGenerator.java
+++ b/src/main/java/de/thedevstack/conversationsplus/generator/PresenceGenerator.java
@@ -2,6 +2,7 @@ package de.thedevstack.conversationsplus.generator;
import de.thedevstack.conversationsplus.entities.Account;
import de.thedevstack.conversationsplus.entities.Contact;
+import de.thedevstack.conversationsplus.entities.Presence;
import de.thedevstack.conversationsplus.xml.Element;
import de.thedevstack.conversationsplus.xmpp.stanzas.PresencePacket;
@@ -31,12 +32,14 @@ public class PresenceGenerator extends AbstractGenerator {
return subscription("subscribed", contact);
}
- public PresencePacket sendPresence(Account account) {
+ public PresencePacket selfPresence(Account account, Presence.Status status) {
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) {
- packet.addChild("status").setContent("online");
packet.addChild("x", "jabber:x:signed").setContent(sig);
}
String capHash = getCapHash();