mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 22:12:05 +01:00
Default to null presence mode (SMACK-193).
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7072 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
98bf0d8cfb
commit
b25b9d5d7c
2 changed files with 12 additions and 2 deletions
|
@ -447,7 +447,17 @@ public class Roster implements ConnectionListener {
|
||||||
}
|
}
|
||||||
// If equal priority, choose "most available" by the mode value.
|
// If equal priority, choose "most available" by the mode value.
|
||||||
else if (p.getPriority() == presence.getPriority()) {
|
else if (p.getPriority() == presence.getPriority()) {
|
||||||
if (p.getMode().compareTo(presence.getMode()) < 0) {
|
Presence.Mode pMode = p.getMode();
|
||||||
|
// Default to presence mode of available.
|
||||||
|
if (pMode == null) {
|
||||||
|
pMode = Presence.Mode.available;
|
||||||
|
}
|
||||||
|
Presence.Mode presenceMode = presence.getMode();
|
||||||
|
// Default to presence mode of available.
|
||||||
|
if (presenceMode == null) {
|
||||||
|
presenceMode = Presence.Mode.available;
|
||||||
|
}
|
||||||
|
if (pMode.compareTo(presenceMode) < 0) {
|
||||||
presence = p;
|
presence = p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class Presence extends Packet {
|
||||||
private Type type = Type.available;
|
private Type type = Type.available;
|
||||||
private String status = null;
|
private String status = null;
|
||||||
private int priority = -1;
|
private int priority = -1;
|
||||||
private Mode mode = Mode.available;
|
private Mode mode = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new presence update. Status, priority, and mode are left un-set.
|
* Creates a new presence update. Status, priority, and mode are left un-set.
|
||||||
|
|
Loading…
Reference in a new issue