powered by Jive Software

Can't find the buddy in rostergroup after relogin


#1

I’m success to add a buddy to a rostergroup (such as Buddies) by xiff 3.1 lib and chatManager, after relogin i can’t find the buddy in ‘Buddies’ group 。

why?

code:

// add buddy

chatManager.addBuddy(new UnescapedJID("user2@test.zhengtuo.net/xiff"));

// find buddy after login

trace(chatManager.roster.contains(

RosterItemVO.get((chatManager.chatUserRoster.getItemAt(0) as ChatUser).rosterItem.jid,

false))); //return true

trace(chatManager.roster.getGroup(“Buddies”)); // return true

trace(chatManager.roster.getGroup(“Buddies”).contains(

RosterItemVO.get((chatManager.chatUserRoster.getItemAt(0) as ChatUser).rosterItem.jid,

false))); // return false
plugins-as-full-domainhandlers-openfire-3.9.2.patch.zip (1427 Bytes)


#2

It’s a xiff’s bug。

code:

//RosterItem class

public function get groupNames():Array

{

var list:Array = [];

var groups:XMLList = xml.children().(localName() == “group”);

for each ( var item:XML in groups )

{

list.push( item ); //item is a xml object;

}

return list;

}

//Roster class

private function setContactGroups( contact:IRosterItemVO, groupNames:Array ):void

{

for each ( var group:RosterGroup in _groups )

{

if ( groupNames.indexOf( **group.label **) >= 0 )

** // group.label is String object, can’t find the rostergroup in groupNames**

{

group.addItem( contact );

}

else

{

group.removeItem( contact );

}

}

}