Create RoomMember.getBestName() extension.
This commit is contained in:
parent
f15d846596
commit
ea0825a01c
2 changed files with 6 additions and 1 deletions
|
|
@ -32,3 +32,7 @@ data class RoomMember(
|
|||
enum class RoomMembershipState {
|
||||
BAN, INVITE, JOIN, KNOCK, LEAVE
|
||||
}
|
||||
|
||||
fun RoomMember.getBestName(): String {
|
||||
return displayName?.takeIf { it.isNotEmpty() } ?: userId.value
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue