Presence class cleanup

This commit is contained in:
Florian Schmaus 2014-09-03 17:50:12 +02:00
parent 66be759ce6
commit 644ddf3d4c
1 changed files with 4 additions and 4 deletions

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;
}