ProfileService

interface ProfileService

This interface defines methods to handling profile information. It's implemented at the session level.

Types

Link copied to clipboard
object Constants

Functions

Link copied to clipboard
abstract suspend fun addThreePid(threePid: ThreePid)

Add a 3Pids. This is the first step to add a ThreePid to an account. Then the threePid will be added to the pending threePid list.

Link copied to clipboard
abstract suspend fun cancelAddingThreePid(threePid: ThreePid)

Cancel adding a threepid. It will remove locally stored data about this ThreePid.

Link copied to clipboard
abstract suspend fun deleteThreePid(threePid: ThreePid)

Remove a 3Pid from the Matrix account.

Link copied to clipboard
abstract suspend fun finalizeAddingThreePid(threePid: ThreePid, userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor)

Finalize adding a 3Pids. Call this method once the user has validated that he owns the ThreePid.

Link copied to clipboard
abstract suspend fun getAvatarUrl(userId: String): Optional<String>

Return the current avatarUrl for this user.

Link copied to clipboard
abstract suspend fun getDisplayName(userId: String): Optional<String>

Return the current display name for this user.

Link copied to clipboard
abstract fun getPendingThreePids(): List<ThreePid>

Get the pending 3Pids, i.e. ThreePids that have requested a token, but not yet validated by the user.

Link copied to clipboard
abstract fun getPendingThreePidsLive(): LiveData<List<ThreePid>>

Get the pending 3Pids Live.

Link copied to clipboard
abstract suspend fun getProfile(userId: String): JsonDict

Get the combined profile information for this user. This may return keys which are not limited to displayname or avatar_url. If server is configured as limit_profile_requests_to_users_who_share_rooms: true then response can be HTTP 403.

Link copied to clipboard
open suspend fun getProfileAsUser(userId: String): User

Return a User object from a userId.

Link copied to clipboard
abstract fun getThreePids(): List<ThreePid>

Get the current user 3Pids.

Link copied to clipboard
abstract fun getThreePidsLive(refreshData: Boolean): LiveData<List<ThreePid>>

Get the current user 3Pids Live.

Link copied to clipboard
abstract suspend fun setDisplayName(userId: String, newDisplayName: String)

Update the display name for this user.

Link copied to clipboard
abstract suspend fun submitSmsCode(threePid: ThreePid.Msisdn, code: String)

Validate a code received by text message.

Link copied to clipboard
abstract suspend fun updateAvatar(    userId: String,     newAvatarUri: Uri,     fileName: String)

Update the avatar for this user.