mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-11 01:59:38 +02:00
Implement support for roster versioning
Roster versioning is defined in RFC 6121, section 2.2.6; the protocol was originally described in XEP-0237. Fixes SMACK-399
This commit is contained in:
parent
e7a2cad401
commit
c06b0a7720
14 changed files with 1300 additions and 147 deletions
|
@ -419,6 +419,10 @@ public class PacketParserUtils {
|
|||
RosterPacket roster = new RosterPacket();
|
||||
boolean done = false;
|
||||
RosterPacket.Item item = null;
|
||||
|
||||
String version = parser.getAttributeValue("", "ver");
|
||||
roster.setVersion(version);
|
||||
|
||||
while (!done) {
|
||||
int eventType = parser.next();
|
||||
if (eventType == XmlPullParser.START_TAG) {
|
||||
|
@ -436,7 +440,7 @@ public class PacketParserUtils {
|
|||
RosterPacket.ItemType type = RosterPacket.ItemType.valueOf(subscription != null ? subscription : "none");
|
||||
item.setItemType(type);
|
||||
}
|
||||
if (parser.getName().equals("group") && item!= null) {
|
||||
else if (parser.getName().equals("group") && item!= null) {
|
||||
final String groupName = parser.nextText();
|
||||
if (groupName != null && groupName.trim().length() > 0) {
|
||||
item.addGroupName(groupName);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue