Skip to main content

onUserJoinedConversation

Triggered when one or more new people join a conversation your App is already in.

warning

Invoked also when App itself is added to a conversation.

Received properties

  • conversationId — Identifier of the conversation the people are added to.
  • members — List of added members, represented by ConversationMember objects.
    Each member includes:
    • userId — Unique user ID (QualifiedId).
    • role — The user’s role in the conversation: ADMIN or MEMBER.

Sample usage

Greeting new joiners

override suspend fun onUserJoinedConversation(
conversationId: QualifiedId,
members: List<ConversationMember>
) {
val users = members.map { manager.getUserSuspending(it.userId) }
val welcomeText = buildString {
append("Welcome ")
append(users.joinToString(" and ") { it.name })
append("!")
}
val message = WireMessage.Text.create(
conversationId = conversationId,
text = welcomeText
)
manager.sendMessageSuspending(message)
}