Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions core/src/main/kotlin/chat/rocket/core/internal/rest/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ suspend fun RocketChatClient.updateProfile(
return handleRestCall<RestResult<User>>(request, type).result()
}

/**
* Get user profile by id.
*
* @param userId The ID of the user.
* @return An [User] profile.
*/
suspend fun RocketChatClient.getProfile(userId: String): User {
val urlBuilder = requestUrl(restUrl, "users.info")
.addQueryParameter("userId", userId)

val request = requestBuilderForAuthenticatedMethods(urlBuilder.build()).get().build()

val type = Types.newParameterizedType(RestResult::class.java, User::class.java)
return handleRestCall<RestResult<User>>(request, type).result()
}

/**
* Updates own basic information for the user.
*
Expand Down