mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 14:02: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 {
|
||||
// Find the resource with the highest priority
|
||||
// Might be changed to use the resource with the highest availability instead.
|
||||
Iterator<String> it = userPresences.keySet().iterator();
|
||||
Presence p;
|
||||
Presence presence = null;
|
||||
|
||||
while (it.hasNext()) {
|
||||
p = userPresences.get(it.next());
|
||||
if (presence == null) {
|
||||
for (String resource : userPresences.keySet()) {
|
||||
Presence p = userPresences.get(resource);
|
||||
if (presence == null || p.getPriority() > presence.getPriority()) {
|
||||
presence = p;
|
||||
}
|
||||
else {
|
||||
if (p.getPriority() > presence.getPriority()) {
|
||||
presence = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
return presence;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue