Make Presence.getMode() return available if null

This commit is contained in:
Florian Schmaus 2015-02-03 18:58:45 +01:00
parent 4013c68584
commit 5c16fdb017
1 changed files with 4 additions and 3 deletions

View File

@ -180,13 +180,14 @@ public final class Presence extends Packet {
}
/**
* Returns the mode of the presence update, or <tt>null</tt> if the mode is not set.
* A null presence mode value is interpreted to be the same thing as
* {@link Presence.Mode#available}.
* Returns the mode of the presence update.
*
* @return the mode.
*/
public Mode getMode() {
if (mode == null) {
return Mode.available;
}
return mode;
}