aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/generator/PresenceGenerator.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-03-06 19:42:55 +0100
committerlookshe <github@lookshe.org>2016-03-06 19:42:55 +0100
commit3c400703e082a1b180b35d891b8fb3460c7d5b87 (patch)
tree28738dd90fc41b4ab71897f38d324828778ad2e3 /src/main/java/de/thedevstack/conversationsplus/generator/PresenceGenerator.java
parent72114d732427266024cdd6e27cd8d1aa60afae2f (diff)
parentf28d77dc42f6bac5a026e0b1c78562dee8de45ac (diff)
Merge branch 'trz/rebase' into trz/rename
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();