Improve "was" fallback for Empty rooms.
This commit is contained in:
parent
923715aeb3
commit
e811c53c44
|
@ -32,7 +32,14 @@ class VectorRoomDisplayNameFallbackProvider(
|
||||||
return if (leftMemberNames.isEmpty()) {
|
return if (leftMemberNames.isEmpty()) {
|
||||||
context.getString(R.string.room_displayname_empty_room)
|
context.getString(R.string.room_displayname_empty_room)
|
||||||
} else {
|
} else {
|
||||||
context.getString(R.string.room_displayname_empty_room_was, leftMemberNames.joinToString())
|
val was = when (val size = leftMemberNames.size) {
|
||||||
|
1 -> getNameFor1member(leftMemberNames[0])
|
||||||
|
2 -> getNameFor2members(leftMemberNames[0], leftMemberNames[1])
|
||||||
|
3 -> getNameFor3members(leftMemberNames[0], leftMemberNames[1], leftMemberNames[2])
|
||||||
|
4 -> getNameFor4members(leftMemberNames[0], leftMemberNames[1], leftMemberNames[2], leftMemberNames[3])
|
||||||
|
else -> getNameFor4membersAndMore(leftMemberNames[0], leftMemberNames[1], leftMemberNames[2], size - 3)
|
||||||
|
}
|
||||||
|
context.getString(R.string.room_displayname_empty_room_was, was)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue