Skip to main content

Getting user information

Through the WireApplicationManager you can retrieve user information based on their QualifiedId.

UserResponse

The getUser method returns a UserResponse object containing:

  • id — The user's QualifiedId
  • name — The user's display name
  • handle — The user's unique handle (username)
  • email — The user's email address (if available)
  • teamId — The UUID of the team the user belongs to (if any)
  • accentId — The user's accent color ID
  • supportedProtocols — List of cryptographic protocols supported by the user
  • deleted — Whether the user has been deleted

Use Case: Get a user's display name and handle

val applicationManager = wireAppSdk.getApplicationManager()

val userId = QualifiedId(
id = UUID.fromString("user-id"),
domain = "user-domain.com"
)

val user: UserResponse = applicationManager.getUserSuspending(userId)

println("Display name: ${user.name}")
println("Handle: @${user.handle}")

Use Case: Get user info from a received message

When you receive a message, you can use the sender's QualifiedId to fetch their information:

override suspend fun onTextMessageSuspending(message: WireMessage.Text) {
val senderInfo = manager.getUserSuspending(message.sender)
println("Message from ${senderInfo.name}: ${message.text}")
}