Add low priority section in DM tab #3463

This commit is contained in:
Benoit Marty 2021-07-19 18:23:14 +02:00
parent ca2794193c
commit ac8303bb99
3 changed files with 34 additions and 7 deletions

1
changelog.d/3463.feature Normal file
View file

@ -0,0 +1 @@
Add low priority section in DM tab

View file

@ -52,7 +52,7 @@ class GroupRoomListSectionBuilder(
when (mode) { when (mode) {
RoomListDisplayMode.PEOPLE -> { RoomListDisplayMode.PEOPLE -> {
// 3 sections Invites / Fav / Dms // 4 sections Invites / Fav / Dms / Low Priority
buildPeopleSections(sections, activeGroupAwareQueries, actualGroupId) buildPeopleSections(sections, activeGroupAwareQueries, actualGroupId)
} }
RoomListDisplayMode.ROOMS -> { RoomListDisplayMode.ROOMS -> {
@ -218,7 +218,19 @@ class GroupRoomListSectionBuilder(
) { ) {
it.memberships = listOf(Membership.JOIN) it.memberships = listOf(Membership.JOIN)
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM 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 it.activeGroupId = actualGroupId
} }
} }
@ -231,7 +243,6 @@ class GroupRoomListSectionBuilder(
withQueryParams( withQueryParams(
{ query.invoke(it) }, { query.invoke(it) },
{ roomQueryParams -> { roomQueryParams ->
val name = stringProvider.getString(nameRes) val name = stringProvider.getString(nameRes)
session.getFilteredPagedRoomSummariesLive(roomQueryParams) session.getFilteredPagedRoomSummariesLive(roomQueryParams)
.also { .also {

View file

@ -261,7 +261,8 @@ class SpaceRoomListSectionBuilder(
private fun buildDmSections(sections: MutableList<RoomsSection>, activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) { private fun buildDmSections(sections: MutableList<RoomsSection>, activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) {
if (autoAcceptInvites.showInvites()) { if (autoAcceptInvites.showInvites()) {
addSection(sections = sections, addSection(
sections = sections,
activeSpaceUpdaters = activeSpaceAwareQueries, activeSpaceUpdaters = activeSpaceAwareQueries,
nameRes = R.string.invitations_header, nameRes = R.string.invitations_header,
notifyOfLocalEcho = true, notifyOfLocalEcho = true,
@ -273,7 +274,8 @@ class SpaceRoomListSectionBuilder(
} }
} }
addSection(sections, addSection(
sections,
activeSpaceAwareQueries, activeSpaceAwareQueries,
R.string.bottom_action_favourites, R.string.bottom_action_favourites,
false, false,
@ -284,7 +286,8 @@ class SpaceRoomListSectionBuilder(
it.roomTagQueryFilter = RoomTagQueryFilter(true, null, null) it.roomTagQueryFilter = RoomTagQueryFilter(true, null, null)
} }
addSection(sections, addSection(
sections,
activeSpaceAwareQueries, activeSpaceAwareQueries,
R.string.bottom_action_people_x, R.string.bottom_action_people_x,
false, false,
@ -292,7 +295,19 @@ class SpaceRoomListSectionBuilder(
) { ) {
it.memberships = listOf(Membership.JOIN) it.memberships = listOf(Membership.JOIN)
it.roomCategoryFilter = RoomCategoryFilter.ONLY_DM 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)
} }
} }