# PresencesRx

class PresencesRx

Reactive API of Presences.

This class replicates some of the methods included in Presences but using Rx types as return values instead of callbacks. It also exposes the presence events using Rx observables.

## Properties

localPresenceUpdated
Link copied to clipboard
val localPresenceUpdated: Observable<Presence>

Emits when the Presence of the local user gets updated.

remotePresenceUpdated
Link copied to clipboard
val remotePresenceUpdated: Observable<Presence>

Emits when the Presence of a remote user gets updated.

## Functions

getOwnPresence
Link copied to clipboard
fun getOwnPresence(): Single<Presence>

Fetches the presence for the current user.

getPresenceForContact
Link copied to clipboard
fun getPresenceForContact(contact: Contact): Maybe<Presence>

Fetches the presence for the specified contact.

getPresences
Link copied to clipboard
fun getPresences(withoutAvatar: Boolean): Single<List<Presence>>

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

subscribeToOwnPresence
Link copied to clipboard
fun subscribeToOwnPresence(): Single<Presence>

Subscribes to the presence for the current user.

subscribeToPresence
Link copied to clipboard
fun subscribeToPresence(contact: Contact): Maybe<Presence>

Subscribes to the presence of the specified contact.

subscribeToPresenceBy
Link copied to clipboard
fun subscribeToPresenceBy(userUri: String): Maybe<Presence>

Subscribes to the presence of the specified userUri.

subscribeToPresences
Link copied to clipboard
fun subscribeToPresences(contacts: List<Contact>): Single<List<Presence>>

Subscribes to the presence of each contact included in contacts.

subscribeToPresencesBy
Link copied to clipboard
fun subscribeToPresencesBy(userUris: List<String>): Single<List<Presence>>

Subscribes to the presence of each contact included in userUris.

updateOwnAvatar
Link copied to clipboard
fun updateOwnAvatar(avatar: String): Single<Presence>

Updates the current user avatar.

updateOwnDisplayName
Link copied to clipboard
fun updateOwnDisplayName(displayName: String): Single<Presence>

Updates the current user displayName.

updateOwnMood
Link copied to clipboard
fun updateOwnMood(mood: String): Single<Presence>

Updates the current user mood.

updateOwnPresence
Link copied to clipboard
fun updateOwnPresence(request: UpdatePresenceRequest): Single<Presence>

Updates the presence for the current user.

updateOwnState
Link copied to clipboard
fun updateOwnState(state: Presence.State): Single<Presence>

Updates the current user state.