Presences

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).

Functions

Link copied to clipboard
fun addListener(listener: PresencesListener)

Adds a listener to receive presence events.

Link copied to clipboard
fun getOwnPresence(onCompletion: (Either<Presence, SippoResourceError>) -> Unit)

Fetches the presence for the current user.

Link copied to clipboard
fun getPresenceForContact(contact: Contact, onCompletion: (Either<Presence?, SippoResourceError>) -> Unit)

Fetches the presence for the specified contact.

Link copied to clipboard
fun getPresences(withoutAvatar: Boolean, onCompletion: (Either<List<Presence>, SippoResourceError>) -> Unit)

Fetches all the presences to which the current user is subscribed.

Link copied to clipboard
fun removeListener(listener: PresencesListener)

Removes the specified listener.

Link copied to clipboard
fun subscribeToOwnPresence(onCompletion: (Either<Presence, SippoResourceError>) -> Unit)

Subscribes to the presence for the current user.

Link copied to clipboard
fun subscribeToPresence(contact: Contact, onCompletion: (Either<Presence?, SippoResourceError>) -> Unit)

Subscribes to the presence of the specified contact.

Link copied to clipboard
fun subscribeToPresenceBy(userUri: String, onCompletion: (Either<Presence?, SippoResourceError>) -> Unit)

Subscribes to the presence of the specified userUri.

Link copied to clipboard
fun subscribeToPresences(contacts: List<Contact>, onCompletion: (Either<List<Presence>, SippoResourceError>) -> Unit)

Subscribes to the presence of each contact included in contacts.

Link copied to clipboard
fun subscribeToPresencesBy(userUris: List<String>, onCompletion: (Either<List<Presence>, SippoResourceError>) -> Unit)

Subscribes to the presence of each contact included in userUris.

Link copied to clipboard
fun updateOwnPresence(presence: Presence, onCompletion: (Either<Presence, SippoResourceError>) -> Unit)

Updates the presence for the current user.

Properties

Link copied to clipboard
val rx: PresencesRx

Access to the reactive API of the service.