Adds clearing to directParentNames

This commit is contained in:
ericdecanini 2022-07-04 09:37:36 +01:00
parent b437996208
commit e003bc973a
2 changed files with 2 additions and 1 deletions

View file

@ -224,6 +224,7 @@ internal class RoomSummaryUpdater @Inject constructor(
.sort(RoomSummaryEntityFields.ROOM_ID)
.findAll().map {
it.flattenParentIds = null
it.directParentNames.clear()
it to emptyList<RoomSummaryEntity>().toMutableSet()
}
.toMap()

View file

@ -207,7 +207,7 @@ class RoomSummaryItemFactory @Inject constructor(
private fun getSearchResultSubtitle(roomSummary: RoomSummary): String {
val userId = roomSummary.directUserId
val directParent = roomSummary.directParentNames.lastOrNull()
val directParent = roomSummary.directParentNames.takeIf { it.isNotEmpty() }?.joinToString()
val canonicalAlias = roomSummary.canonicalAlias
return (userId ?: directParent ?: canonicalAlias).orEmpty()