mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-29 17:52:06 +01:00
1.5
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@6262 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
c3aad4dec1
commit
7a16b8ff95
1 changed files with 3 additions and 10 deletions
|
@ -432,20 +432,13 @@ public class Roster implements ConnectionListener {
|
||||||
else {
|
else {
|
||||||
// Find the resource with the highest priority
|
// Find the resource with the highest priority
|
||||||
// Might be changed to use the resource with the highest availability instead.
|
// Might be changed to use the resource with the highest availability instead.
|
||||||
Iterator<String> it = userPresences.keySet().iterator();
|
|
||||||
Presence p;
|
|
||||||
Presence presence = null;
|
Presence presence = null;
|
||||||
|
|
||||||
while (it.hasNext()) {
|
for (String resource : userPresences.keySet()) {
|
||||||
p = userPresences.get(it.next());
|
Presence p = userPresences.get(resource);
|
||||||
if (presence == null) {
|
if (presence == null || p.getPriority() > presence.getPriority()) {
|
||||||
presence = p;
|
presence = p;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (p.getPriority() > presence.getPriority()) {
|
|
||||||
presence = p;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return presence;
|
return presence;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue