1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 04:57:58 +01:00

Presence class cleanup

This commit is contained in:
Florian Schmaus 2014-09-03 17:50:12 +02:00
parent 66be759ce6
commit 644ddf3d4c

View file

@ -57,6 +57,8 @@ import org.jivesoftware.smack.util.XmlStringBuilder;
*/
public class Presence extends Packet {
public static final String ELEMENT = "presence";
private Type type = Type.available;
private String status = null;
private int priority = Integer.MIN_VALUE;
@ -69,7 +71,6 @@ public class Presence extends Packet {
* @param type the type.
*/
public Presence(Type type) {
super();
setType(type);
}
@ -82,7 +83,6 @@ public class Presence extends Packet {
* @param mode the mode type for this presence update.
*/
public Presence(Type type, String status, int priority, Mode mode) {
super();
setType(type);
setStatus(status);
setPriority(priority);
@ -227,7 +227,7 @@ public class Presence extends Packet {
@Override
public XmlStringBuilder toXML() {
XmlStringBuilder buf = new XmlStringBuilder();
buf.halfOpenElement("presence");
buf.halfOpenElement(ELEMENT);
buf.xmlnsAttribute(getXmlns());
buf.xmllangAttribute(getLanguage());
addCommonAttributes(buf);
@ -250,7 +250,7 @@ public class Presence extends Packet {
if (error != null) {
buf.append(error.toXML());
}
buf.closeElement("presence");
buf.closeElement(ELEMENT);
return buf;
}