mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-09 00:29:00 +01:00
Changes string format of space parents to maintain parity with web
This commit is contained in:
parent
98d195c010
commit
c6728dde38
@ -207,9 +207,18 @@ class RoomSummaryItemFactory @Inject constructor(
|
||||
|
||||
private fun getSearchResultSubtitle(roomSummary: RoomSummary): String {
|
||||
val userId = roomSummary.directUserId
|
||||
val directParent = roomSummary.directParentNames.takeIf { it.isNotEmpty() }?.joinToString()
|
||||
val directParent = joinParentNames(roomSummary)
|
||||
val canonicalAlias = roomSummary.canonicalAlias
|
||||
|
||||
return (userId ?: directParent ?: canonicalAlias).orEmpty()
|
||||
}
|
||||
|
||||
private fun joinParentNames(roomSummary: RoomSummary) = with(roomSummary) {
|
||||
when (directParentNames.size) {
|
||||
0 -> null
|
||||
1 -> directParentNames.first()
|
||||
2 -> stringProvider.getString(R.string.search_space_two_parents, directParentNames[0], directParentNames[1])
|
||||
else -> stringProvider.getString(R.string.search_space_multiple_parents, directParentNames.first(), directParentNames.size - 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -762,6 +762,8 @@
|
||||
<string name="search_members_hint">Filter room members</string>
|
||||
<string name="search_banned_user_hint">Filter banned users</string>
|
||||
<string name="search_no_results">No results</string>
|
||||
<string name="search_space_two_parents">%1$s and %2$s</string>
|
||||
<string name="search_space_multiple_parents">%1$s and %2$d others</string>
|
||||
|
||||
<!-- home room settings -->
|
||||
<string name="room_settings_all_messages">All messages</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user