public final class Idle extends Object
<idle/> element in the urn:xmpp:idle:1 namespace.
It also provides a convenient method, which gets the idle time from a presence with respect to XEP-0319: Last User Interaction in Presence and the superseded XEP-0256: Last Activity in Presence.
presence.addExtension(Idle.since(OffsetDateTime.ofInstant(idleSince, ZoneOffset.UTC)));
This class is immutable.| Modifier and Type | Field and Description |
|---|---|
static String |
NAMESPACE
urn:xmpp:idle:1
|
| Modifier and Type | Method and Description |
|---|---|
OffsetDateTime |
getSince()
Gets the date/time since the entity is idle.
|
static Idle |
since(OffsetDateTime since)
Creates an idle element with the date since when the user is idle.
|
static Instant |
timeFromPresence(Presence presence)
Extracts the idle time from a presence.
|
String |
toString() |
public static final String NAMESPACE
public static Idle since(OffsetDateTime since)
since - The date.public static Instant timeFromPresence(Presence presence)
This methods first checks for a XEP-0319: Last User Interaction in Presence extension and uses XEP-0256: Last Activity in Presence semantics as fallback to determine the idle time.
Delayed delivery information is respected.
presence - The presence.public final OffsetDateTime getSince()
Copyright © 2014–2018 XMPP.rocks. All rights reserved.