class Presences
The presence service.
This class allows performing presence related actions like obtaining the local user presence or subscribing to the presence of one or more contacts. It also allows adding a listener to receive presence events (@see PresencesListener).
val rx: PresencesRx
Access to the reactive API of the service. |
fun addListener(listener: PresencesListener): Unit
Adds a listener to receive presence events. |
|
fun getOwnPresence(onCompletion: (Either<Presence, SippoResourceError>) -> Unit): Unit
Fetches the presence for the current user. |
|
fun getPresenceForContact(contact: Contact, onCompletion: (Either<Presence?, SippoResourceError>) -> Unit): Unit fun getPresenceForContact(contact: Contact, onCompletion: (Either<Presence, SippoResourceError>) -> Unit): Unit
Fetches the presence for the specified contact. |
|
fun getPresences(withoutAvatar: Boolean, onCompletion: (Either<List<Presence>, SippoResourceError>) -> Unit): Unit
Fetches all the presences to which the current user is subscribed. |
|
fun removeListener(listener: PresencesListener): Unit
Removes the specified listener. |
|
fun subscribeToPresence(contact: Contact, onCompletion: (Either<Presence?, SippoResourceError>) -> Unit): Unit fun subscribeToPresence(contact: Contact, onCompletion: (Either<Presence, SippoResourceError>) -> Unit): Unit
Subscribes to the presence of the specified contact. |
|
fun subscribeToPresences(contacts: List<Contact>, onCompletion: (Either<List<Presence>, SippoResourceError>) -> Unit): Unit fun subscribeToPresences(contacts: List<Contact>, onCompletion: (Either<List<Presence>, SippoResourceError>) -> Unit): Unit
Subscribes to the presence of each contact included in contacts. |
|
fun updateOwnPresence(presence: Presence, onCompletion: (Either<Presence, SippoResourceError>) -> Unit): Unit
Updates the presence for the current user. |