diff --git a/chat-engine/src/main/kotlin/app/dapk/st/engine/Models.kt b/chat-engine/src/main/kotlin/app/dapk/st/engine/Models.kt index 066ab75..4efb5d6 100644 --- a/chat-engine/src/main/kotlin/app/dapk/st/engine/Models.kt +++ b/chat-engine/src/main/kotlin/app/dapk/st/engine/Models.kt @@ -13,7 +13,8 @@ typealias InviteState = List data class DirectoryItem( val overview: RoomOverview, val unreadCount: UnreadCount, - val typing: Typing? + val typing: Typing?, + val isMuted: Boolean, ) data class RoomOverview( diff --git a/matrix-chat-engine/src/main/kotlin/app/dapk/st/engine/DirectoryUseCase.kt b/matrix-chat-engine/src/main/kotlin/app/dapk/st/engine/DirectoryUseCase.kt index fc876fd..9cf1b85 100644 --- a/matrix-chat-engine/src/main/kotlin/app/dapk/st/engine/DirectoryUseCase.kt +++ b/matrix-chat-engine/src/main/kotlin/app/dapk/st/engine/DirectoryUseCase.kt @@ -24,11 +24,13 @@ internal class DirectoryUseCase( roomStore.observeUnreadCountById(), syncService.events() ) { overviewState, localEchos, unread, events -> + val allMuted = roomStore.allMuted() overviewState.mergeWithLocalEchos(localEchos, userId).map { roomOverview -> DirectoryItem( overview = roomOverview, unreadCount = UnreadCount(unread[roomOverview.roomId] ?: 0), - typing = events.filterIsInstance().firstOrNull { it.roomId == roomOverview.roomId }?.engine() + typing = events.filterIsInstance().firstOrNull { it.roomId == roomOverview.roomId }?.engine(), + isMuted = allMuted.contains(roomOverview.roomId), ) } }