Roster Problem

Hi i’'m new to using smack, (ha ha)(using it about a week) Love it.

I’'m actually having a problem retreiving the roster list from the server, I only seem to be able to get the roster to display at most two users in the roster when there is about 7 or 8 in the groups.

I’'m running it on my local machine,

I don’'t actually have the sample code at the moment but does any body know if ye could help form the limited information i have given,

Sorry it’'s not more discriptive.

Is there any other way to retreive the roster apart from using the iterator .

thanks in advance.

Rob

I am having the exact same problem, only I can only show seem to get one user per group to show. Did you ever find the cause of this problem?

-Ken

Hey guys,

To get all the entries in a roster you can use XMPPConnection.getRoster().getEntries(). Could you open the smack debugger and confirm what the server is actually sending to your client and compare that information with XMPPConnection.getRoster().getEntries()? You should be getting the same information.

Regards,

– Gato

I had actually used that method (.getEntries()), which did in fact return the right number of buddies. Of course, retrieving them in that manner is a ''flat'' retrieval, rather than heirarchacal (even though you can get the groups from the RosterEntry itself). My idea was to build the buddy list from the top down, that is, add a group, then add it''s buddies.

*However...*

Oddly enough though, after I posted my previous message, the same code began to work! That always makes me uneasy, but I won’'t complain! Everything seems to be working fine now - I can add buddies, and they always show up immediatley in the appropriate group.

Thanks!

-Ken

code;

XMPPConnection connection;

try {

connection = new XMPPConnection(“haopu”);

//if (XMPPConnection.DEBUG_ENABLED) {

System.out.println(connection.getRoster().getEntries());

//}

} catch (XMPPException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}