Skip to content

Commit

Permalink
Add low priority section in DM tab #3463
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Jul 19, 2021
1 parent ca27941 commit ac8303b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.d/3463.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add low priority section in DM tab
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class GroupRoomListSectionBuilder(

when (mode) {
RoomListDisplayMode.PEOPLE -> {
// 3 sections Invites / Fav / Dms
// 4 sections Invites / Fav / Dms / Low Priority
buildPeopleSections(sections, activeGroupAwareQueries, actualGroupId)
}
RoomListDisplayMode.ROOMS -> {
Expand Down Expand Up @@ -218,7 +218,19 @@ class GroupRoomListSectionBuilder(
) {
it.memberships = listOf(Membership.JOIN)
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
it.roomTagQueryFilter = RoomTagQueryFilter(false, null, null)
it.roomTagQueryFilter = RoomTagQueryFilter(false, false, null)
it.activeGroupId = actualGroupId
}

addSection(
sections,
activeSpaceAwareQueries,
R.string.low_priority_header,
false
) {
it.memberships = listOf(Membership.JOIN)
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
it.roomTagQueryFilter = RoomTagQueryFilter(false, true, null)
it.activeGroupId = actualGroupId
}
}
Expand All @@ -231,7 +243,6 @@ class GroupRoomListSectionBuilder(
withQueryParams(
{ query.invoke(it) },
{ roomQueryParams ->

val name = stringProvider.getString(nameRes)
session.getFilteredPagedRoomSummariesLive(roomQueryParams)
.also {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ class SpaceRoomListSectionBuilder(

private fun buildDmSections(sections: MutableList<RoomsSection>, activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) {
if (autoAcceptInvites.showInvites()) {
addSection(sections = sections,
addSection(
sections = sections,
activeSpaceUpdaters = activeSpaceAwareQueries,
nameRes = R.string.invitations_header,
notifyOfLocalEcho = true,
Expand All @@ -273,7 +274,8 @@ class SpaceRoomListSectionBuilder(
}
}

addSection(sections,
addSection(
sections,
activeSpaceAwareQueries,
R.string.bottom_action_favourites,
false,
Expand All @@ -284,15 +286,28 @@ class SpaceRoomListSectionBuilder(
it.roomTagQueryFilter = RoomTagQueryFilter(true, null, null)
}

addSection(sections,
addSection(
sections,
activeSpaceAwareQueries,
R.string.bottom_action_people_x,
false,
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL
) {
it.memberships = listOf(Membership.JOIN)
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
it.roomTagQueryFilter = RoomTagQueryFilter(false, null, null)
it.roomTagQueryFilter = RoomTagQueryFilter(false, false, null)
}

addSection(
sections,
activeSpaceAwareQueries,
R.string.low_priority_header,
false,
RoomListViewModel.SpaceFilterStrategy.ALL_IF_SPACE_NULL
) {
it.memberships = listOf(Membership.JOIN)
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM
it.roomTagQueryFilter = RoomTagQueryFilter(false, true, null)
}
}

Expand Down

0 comments on commit ac8303b

Please sign in to comment.