Render kick and ban reason in the timeline when available (#4642)

* Map the reason to RoomMembershipContent

* Create function to create RoomMembershipContent.

* Render reason for kick and ban state event.
This commit is contained in:
Benoit Marty 2025-04-30 18:13:53 +02:00 committed by GitHub
parent b4b93a64d6
commit e502eb1971
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 164 additions and 78 deletions

View file

@ -0,0 +1,25 @@
/*
* Copyright 2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.matrix.test.timeline.item.event
import io.element.android.libraries.matrix.api.core.UserId
import io.element.android.libraries.matrix.api.timeline.item.event.MembershipChange
import io.element.android.libraries.matrix.api.timeline.item.event.RoomMembershipContent
import io.element.android.libraries.matrix.test.A_USER_ID
fun aRoomMembershipContent(
userId: UserId = A_USER_ID,
userDisplayName: String? = null,
change: MembershipChange? = null,
reason: String? = null,
) = RoomMembershipContent(
userId = userId,
userDisplayName = userDisplayName,
change = change,
reason = reason,
)