Merge pull request #2374 from element-hq/feature/bma/typingRendering

Typing notification rendering
This commit is contained in:
Benoit Marty 2024-02-09 22:29:14 +01:00 committed by GitHub
commit b8d9c89ec4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 708 additions and 4 deletions

View file

@ -57,6 +57,7 @@ interface MatrixRoom : Closeable {
val isDm: Boolean get() = isDirect && isOneToOne
val roomInfoFlow: Flow<MatrixRoomInfo>
val roomTypingMembersFlow: Flow<List<UserId>>
/**
* A one-to-one is a room with exactly 2 members.

View file

@ -27,7 +27,19 @@ data class RoomMember(
val powerLevel: Long,
val normalizedPowerLevel: Long,
val isIgnored: Boolean,
)
) {
/**
* Disambiguated display name for the RoomMember.
* If the display name is null, the user ID is returned.
* If the display name is ambiguous, the user ID is appended in parentheses.
* Otherwise, the display name is returned.
*/
val disambiguatedDisplayName: String = when {
displayName == null -> userId.value
isNameAmbiguous -> "$displayName ($userId)"
else -> displayName
}
}
enum class RoomMembershipState {
BAN,