aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/generator
diff options
context:
space:
mode:
authorChristian S <christian@pix-art.de>2016-02-04 18:02:03 +0100
committerChristian S <christian@pix-art.de>2016-02-04 18:02:03 +0100
commit14b688e0fbe62a0fef0fadcc20763faa21801d7a (patch)
tree37fc7b87aa21326b0ca7ba97fee84aaf0ea6d3c2 /src/main/java/eu/siacs/conversations/generator
parent9e96d80e31c5d0455c4b15984eef5709cf1071fc (diff)
parent91ec4839acef3e395e83815f211dd9771af1287e (diff)
Merge remote-tracking branch 'siacs/master' into development
Diffstat (limited to 'src/main/java/eu/siacs/conversations/generator')
-rw-r--r--src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java b/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
index fdfde88c7..093a8963f 100644
--- a/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
+++ b/src/main/java/eu/siacs/conversations/generator/PresenceGenerator.java
@@ -2,7 +2,7 @@ package eu.siacs.conversations.generator;
import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Contact;
-import eu.siacs.conversations.entities.Presences;
+import eu.siacs.conversations.entities.Presence;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.xml.Element;
import eu.siacs.conversations.xmpp.stanzas.PresencePacket;
@@ -37,21 +37,10 @@ public class PresenceGenerator extends AbstractGenerator {
return subscription("subscribed", contact);
}
- public PresencePacket selfPresence(Account account, int presence) {
+ public PresencePacket selfPresence(Account account, Presence.Status status) {
PresencePacket packet = new PresencePacket();
- switch(presence) {
- case Presences.AWAY:
- packet.addChild("show").setContent("away");
- break;
- case Presences.XA:
- packet.addChild("show").setContent("xa");
- break;
- case Presences.CHAT:
- packet.addChild("show").setContent("chat");
- break;
- case Presences.DND:
- packet.addChild("show").setContent("dnd");
- break;
+ if(status.toShowString() != null) {
+ packet.addChild("show").setContent(status.toShowString());
}
packet.setFrom(account.getJid());
String sig = account.getPgpSignature();