1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

changed "local entry" solution to "wrapper class" solution

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2065 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2003-08-24 16:05:45 +00:00 committed by gdombiak
parent 779f6ab82f
commit ca37ceb2f1
9 changed files with 1018 additions and 247 deletions

View file

@ -114,15 +114,18 @@ entries to his roster.
RosterExchangeManager rosterExchangeManager2 = new RosterExchangeManager(conn2);
<font color="#3f7f5f">// Create a RosterExchangeListener that will iterate over the received roster entries</font>
RosterExchangeListener rosterExchangeListener = new RosterExchangeListener() {
public void entriesReceived(String from, Iterator rosterEntries) {
for (Iterator it = rosterEntries; it.hasNext();) {
public void entriesReceived(String from, Iterator remoteRosterEntries) {
while (remoteRosterEntries.hasNext()) {
try {
<font color="#3f7f5f">// Get the received entry</font>
RosterEntry entry = (RosterEntry) it.next();
<font color="#3f7f5f">// Display the entry on the console</font>
System.out.println(entry);
RemoteRosterEntry remoteRosterEntry = (RemoteRosterEntry) remoteRosterEntries.next();
<font color="#3f7f5f">// Display the remote entry on the console</font>
System.out.println(remoteRosterEntry);
<font color="#3f7f5f">// Add the entry to the user2's roster</font>
user2_roster.createEntry(entry);
user2_roster.createEntry(
remoteRosterEntry.getUser(),
remoteRosterEntry.getName(),
remoteRosterEntry.getGroupArrayNames());
}
catch (XMPPException e) {
e.printStackTrace();