Permalink
Browse files

Fix problem with getting group names from roster pushes

  • Loading branch information...
benlangfeld committed Jan 15, 2011
1 parent 0812aa9 commit 4675aabb2ed563d42fb5d36c3f0ebae46ec67a78
Showing with 10 additions and 2 deletions.
  1. +10 −2 TNStropheRoster.j
View
@@ -353,14 +353,18 @@
var contact = [TNStropheContact contactWithConnection:_connection JID:theJID groupName:groupName],
nickname = [aRosterItem valueForAttribute:@"name"] || [theJID node],
- groupNames = [aRosterItem childrenWithName:@"group"] || [CPArray array],
+ groupNodes = [aRosterItem childrenWithName:@"group"],
+ groupNames = [CPArray array],
queuedPresence = [self pendingPresenceForJID:theJID],
subscription = [aRosterItem valueForAttribute:@"subscription"];
[_contacts addObject:contact];
[groupNames addObject:[_defaultGroup name]];
+ for (var i = 0; i < [groupNodes count]; i++)
+ [groupNames addObject:[[groupNodes objectAtIndex:i] text]];
+
for (var i = 0; i < [groupNames count]; i++)
{
var groupName = [groupNames objectAtIndex:i],
@@ -419,10 +423,14 @@
else
{
var nickname = [aRosterItem valueForAttribute:@"name"] || [theJID node],
- groupNames = [aRosterItem childrenWithName:@"group"] || [CPArray array];
+ groupNodes = [aRosterItem childrenWithName:@"group"],
+ groupNames = [CPArray array];
[groupNames addObject:[_defaultGroup name]];
+ for (var i = 0; i < [groupNodes count]; i++)
+ [groupNames addObject:[[groupNodes objectAtIndex:i] text]];
+
[contact setNickname:nickname];
// Remove contact from all groups

0 comments on commit 4675aab

Please sign in to comment.