package de.thedevstack.conversationsplus.xmpp.stanzas; import de.thedevstack.conversationsplus.entities.Presence; public class PresencePacket extends AbstractAcknowledgeableStanza { public PresencePacket() { super("presence"); } public PresencePacket(Presence.Status status) { super("presence"); String show; switch(status) { case CHAT: show = "chat"; break; case AWAY: show = "away"; break; case XA: show = "xa"; break; case DND: show = "dnd"; break; default: show = null; } if(show != null) { this.addChild("show").setContent(show); } } }