Fix compile after merge

Change-Id: I499115f40f75f07cdd0e42dafa2b17695d27e9b5
This commit is contained in:
SpiritCroc 2021-05-12 16:16:20 +02:00
parent 5c68ccf67d
commit 077e1b6896
5 changed files with 47 additions and 27 deletions

View file

@ -150,7 +150,9 @@ class UnreadMessagesSharedViewModel @AssistedInject constructor(@Assisted initia
val counts = RoomAggregateNotificationCount( val counts = RoomAggregateNotificationCount(
totalCount.notificationCount + inviteCount, totalCount.notificationCount + inviteCount,
totalCount.highlightCount + inviteCount totalCount.highlightCount + inviteCount,
totalCount.unreadCount,
totalCount.markedUnreadCount
) )
val rootCounts = session.spaceService().getRootSpaceSummaries() val rootCounts = session.spaceService().getRootSpaceSummaries()
.filter { .filter {

View file

@ -142,10 +142,12 @@ class SpaceRoomListSectionBuilder(
private fun buildUnifiedSections(sections: MutableList<RoomsSection>, activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) { private fun buildUnifiedSections(sections: MutableList<RoomsSection>, activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) {
addSection( addSection(
sections, activeSpaceAwareQueries, sections = sections,
R.string.invitations_header, activeSpaceUpdaters = activeSpaceAwareQueries,
true, nameRes = R.string.invitations_header,
RoomListViewModel.SpaceFilterStrategy.NONE notifyOfLocalEcho = true,
spaceFilterStrategy = RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL,
countRoomAsNotif = true
) { ) {
it.memberships = listOf(Membership.INVITE) it.memberships = listOf(Membership.INVITE)
} }
@ -155,40 +157,52 @@ class SpaceRoomListSectionBuilder(
activeSpaceAwareQueries, activeSpaceAwareQueries,
R.string.bottom_action_favourites, R.string.bottom_action_favourites,
false, false,
RoomListViewModel.SpaceFilterStrategy.NOT_IF_ALL RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL
) { ) {
it.memberships = listOf(Membership.JOIN) it.memberships = listOf(Membership.JOIN)
it.roomTagQueryFilter = RoomTagQueryFilter(true, null, null) it.roomTagQueryFilter = RoomTagQueryFilter(true, null, null)
} }
addSection( addSection(
sections, sections = sections,
activeSpaceAwareQueries, activeSpaceUpdaters = activeSpaceAwareQueries,
R.string.normal_priority_header, nameRes = R.string.bottom_action_rooms,
false, notifyOfLocalEcho = false,
RoomListViewModel.SpaceFilterStrategy.NORMAL spaceFilterStrategy = if (onlyOrphansInHome) {
RoomListViewModel.SpaceFilterStrategy.ORPHANS_IF_SPACE_NULL
} else {
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL
}
) { ) {
it.memberships = listOf(Membership.JOIN) it.memberships = listOf(Membership.JOIN)
it.roomTagQueryFilter = RoomTagQueryFilter(false, false, false) it.roomTagQueryFilter = RoomTagQueryFilter(false, false, false)
} }
addSection( addSection(
sections, sections = sections,
activeSpaceAwareQueries, activeSpaceUpdaters = activeSpaceAwareQueries,
R.string.low_priority_header, nameRes = R.string.low_priority_header,
false, notifyOfLocalEcho = false,
RoomListViewModel.SpaceFilterStrategy.NORMAL spaceFilterStrategy = if (onlyOrphansInHome) {
RoomListViewModel.SpaceFilterStrategy.ORPHANS_IF_SPACE_NULL
} else {
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL
}
) { ) {
it.memberships = listOf(Membership.JOIN) it.memberships = listOf(Membership.JOIN)
it.roomTagQueryFilter = RoomTagQueryFilter(null, true, null) it.roomTagQueryFilter = RoomTagQueryFilter(null, true, null)
} }
addSection( addSection(
sections, sections = sections,
activeSpaceAwareQueries, activeSpaceUpdaters = activeSpaceAwareQueries,
R.string.system_alerts_header, nameRes = R.string.system_alerts_header,
false, notifyOfLocalEcho = false,
RoomListViewModel.SpaceFilterStrategy.NORMAL spaceFilterStrategy = if (onlyOrphansInHome) {
RoomListViewModel.SpaceFilterStrategy.ORPHANS_IF_SPACE_NULL
} else {
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL
}
) { ) {
it.memberships = listOf(Membership.JOIN) it.memberships = listOf(Membership.JOIN)
it.roomTagQueryFilter = RoomTagQueryFilter(null, null, true) it.roomTagQueryFilter = RoomTagQueryFilter(null, null, true)
@ -205,7 +219,7 @@ class SpaceRoomListSectionBuilder(
} else { } else {
liveData(context = viewModelScope.coroutineContext + Dispatchers.IO) { liveData(context = viewModelScope.coroutineContext + Dispatchers.IO) {
val spaceSum = tryOrNull { session.spaceService().querySpaceChildren(selectedSpace.roomId, suggestedOnly = true) } val spaceSum = tryOrNull { session.spaceService().querySpaceChildren(selectedSpace.roomId, suggestedOnly = true) }
val value = spaceSum?.second ?: emptyList() val value = spaceSum?.second.orEmpty().distinctBy { it.childRoomId }
// i need to check if it's already joined. // i need to check if it's already joined.
val filtered = value.filter { val filtered = value.filter {
session.getRoomSummary(it.childRoomId)?.membership?.isActive() != true session.getRoomSummary(it.childRoomId)?.membership?.isActive() != true
@ -393,7 +407,7 @@ class SpaceRoomListSectionBuilder(
activeSpaceAwareQueries, activeSpaceAwareQueries,
R.string.low_priority_header, R.string.low_priority_header,
false, false,
RoomListViewModel.SpaceFilterStrategy.NOT_IF_ALL RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL
) { ) {
it.memberships = listOf(Membership.JOIN) it.memberships = listOf(Membership.JOIN)
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
@ -464,7 +478,7 @@ class SpaceRoomListSectionBuilder(
?.notificationCount ?.notificationCount
?.postValue( ?.postValue(
if (countRoomAsNotif) { if (countRoomAsNotif) {
RoomAggregateNotificationCount(it.size, it.size) RoomAggregateNotificationCount(it.size, it.size, 0, 0)
} else { } else {
session.getNotificationCountForRooms( session.getNotificationCountForRooms(
roomQueryParams.process(spaceFilterStrategy, appStateHandler.safeActiveSpaceId()), roomQueryParams.process(spaceFilterStrategy, appStateHandler.safeActiveSpaceId()),

View file

@ -209,7 +209,9 @@ class SpaceSummaryController @Inject constructor(
countState( countState(
UnreadCounterBadgeView.State( UnreadCounterBadgeView.State(
childSummary.notificationCount, childSummary.notificationCount,
childSummary.highlightCount > 0 childSummary.highlightCount > 0,
childSummary.unreadCount ?: 0,
childSummary.markedUnread
) )
) )
} }

View file

@ -136,7 +136,9 @@ class SpacesListViewModel @AssistedInject constructor(@Assisted initialState: Sp
) )
val counts = RoomAggregateNotificationCount( val counts = RoomAggregateNotificationCount(
totalCount.notificationCount + inviteCount, totalCount.notificationCount + inviteCount,
totalCount.highlightCount + inviteCount totalCount.highlightCount + inviteCount,
totalCount.unreadCount,
if (totalCount.markedUnread) 1 else 0
) )
setState { setState {
copy( copy(

View file

@ -45,7 +45,7 @@ abstract class SubSpaceSummaryItem : VectorEpoxyModel<SubSpaceSummaryItem.Holder
@EpoxyAttribute var expanded: Boolean = false @EpoxyAttribute var expanded: Boolean = false
@EpoxyAttribute var hasChildren: Boolean = false @EpoxyAttribute var hasChildren: Boolean = false
@EpoxyAttribute var indent: Int = 0 @EpoxyAttribute var indent: Int = 0
@EpoxyAttribute var countState: UnreadCounterBadgeView.State = UnreadCounterBadgeView.State(0, false) @EpoxyAttribute var countState: UnreadCounterBadgeView.State = UnreadCounterBadgeView.State(0, false, 0, false)
override fun bind(holder: Holder) { override fun bind(holder: Holder) {
super.bind(holder) super.bind(holder)