mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-27 00:32:07 +01:00
SMACK-294: Improve handling for empty groups
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@11643 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
a441d856f8
commit
379b119d12
2 changed files with 5 additions and 2 deletions
|
@ -233,7 +233,7 @@ public class Roster {
|
||||||
RosterPacket.Item item = new RosterPacket.Item(user, name);
|
RosterPacket.Item item = new RosterPacket.Item(user, name);
|
||||||
if (groups != null) {
|
if (groups != null) {
|
||||||
for (String group : groups) {
|
for (String group : groups) {
|
||||||
if (group != null) {
|
if (group != null && group.trim().length() > 0) {
|
||||||
item.addGroupName(group);
|
item.addGroupName(group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,9 +369,12 @@ public class PacketParserUtils {
|
||||||
item.setItemType(type);
|
item.setItemType(type);
|
||||||
}
|
}
|
||||||
if (parser.getName().equals("group") && item!= null) {
|
if (parser.getName().equals("group") && item!= null) {
|
||||||
|
final String groupName = parser.nextText();
|
||||||
|
if (groupName != null && groupName.trim().length() > 0) {
|
||||||
item.addGroupName(parser.nextText());
|
item.addGroupName(parser.nextText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (eventType == XmlPullParser.END_TAG) {
|
else if (eventType == XmlPullParser.END_TAG) {
|
||||||
if (parser.getName().equals("item")) {
|
if (parser.getName().equals("item")) {
|
||||||
roster.addRosterItem(item);
|
roster.addRosterItem(item);
|
||||||
|
|
Loading…
Reference in a new issue