1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Add ELEMENT and NAMESPACE to RosterPacket

This commit is contained in:
Florian Schmaus 2014-09-12 13:40:04 +02:00
parent c024931de8
commit d57fecfcc9
2 changed files with 7 additions and 4 deletions

View file

@ -34,6 +34,9 @@ import java.util.concurrent.CopyOnWriteArraySet;
*/
public class RosterPacket extends IQ {
public static final String ELEMENT = QUERY_ELEMENT;
public static final String NAMESPACE = "jabber:iq:roster";
private final List<Item> rosterItems = new ArrayList<Item>();
private String rosterVersion;
@ -73,8 +76,8 @@ public class RosterPacket extends IQ {
@Override
public XmlStringBuilder getChildElementXML() {
XmlStringBuilder buf = new XmlStringBuilder();
buf.halfOpenElement("query");
buf.xmlnsAttribute("jabber:iq:roster");
buf.halfOpenElement(ELEMENT);
buf.xmlnsAttribute(NAMESPACE);
buf.optAttribute("ver", rosterVersion);
buf.rightAngleBracket();
@ -83,7 +86,7 @@ public class RosterPacket extends IQ {
buf.append(entry.toXML());
}
}
buf.closeElement("query");
buf.closeElement(ELEMENT);
return buf;
}

View file

@ -534,7 +534,7 @@ public class PacketParserUtils {
if (elementName.equals("error")) {
error = PacketParserUtils.parseError(parser);
}
else if (elementName.equals("query") && namespace.equals("jabber:iq:roster")) {
else if (elementName.equals(RosterPacket.ELEMENT) && namespace.equals(RosterPacket.NAMESPACE)) {
iqPacket = parseRoster(parser);
}
else if (elementName.equals(Bind.ELEMENT) && namespace.equals(Bind.NAMESPACE)) {