mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 09:56:00 +03:00
Cleanup and comment
This commit is contained in:
parent
5990e5a52b
commit
ac2f1ee7fe
2 changed files with 10 additions and 4 deletions
|
@ -86,6 +86,7 @@ class RoomListSectionBuilderGroup(
|
|||
it.activeGroupId = actualGroupId
|
||||
}
|
||||
}
|
||||
|
||||
addSection(
|
||||
sections,
|
||||
activeGroupAwareQueries,
|
||||
|
@ -111,6 +112,7 @@ class RoomListSectionBuilderGroup(
|
|||
}.also {
|
||||
onDisposable.invoke(it)
|
||||
}
|
||||
|
||||
return sections
|
||||
}
|
||||
|
||||
|
@ -257,6 +259,7 @@ class RoomListSectionBuilderGroup(
|
|||
}.also {
|
||||
onDisposable.invoke(it)
|
||||
}
|
||||
|
||||
sections.add(
|
||||
RoomsSection(
|
||||
sectionName = name,
|
||||
|
|
|
@ -70,12 +70,15 @@ class RoomListSectionBuilderSpace(
|
|||
val activeSpaceAwareQueries = mutableListOf<RoomListViewModel.ActiveSpaceQueryUpdater>()
|
||||
when (mode) {
|
||||
RoomListDisplayMode.PEOPLE -> {
|
||||
// 4 sections Invites / Fav / Dms / Low Priority
|
||||
buildDmSections(sections, activeSpaceAwareQueries)
|
||||
}
|
||||
RoomListDisplayMode.ROOMS -> {
|
||||
// 6 sections invites / Fav / Rooms / Low Priority / Server notice / Suggested rooms
|
||||
buildRoomsSections(sections, activeSpaceAwareQueries)
|
||||
}
|
||||
RoomListDisplayMode.FILTERED -> {
|
||||
// Used when searching for rooms
|
||||
withQueryParams(
|
||||
{
|
||||
it.memberships = Membership.activeMemberships()
|
||||
|
@ -140,7 +143,8 @@ class RoomListSectionBuilderSpace(
|
|||
return sections
|
||||
}
|
||||
|
||||
private fun buildRoomsSections(sections: MutableList<RoomsSection>, activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) {
|
||||
private fun buildRoomsSections(sections: MutableList<RoomsSection>,
|
||||
activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) {
|
||||
if (autoAcceptInvites.showInvites()) {
|
||||
addSection(
|
||||
sections = sections,
|
||||
|
@ -259,7 +263,8 @@ class RoomListSectionBuilderSpace(
|
|||
)
|
||||
}
|
||||
|
||||
private fun buildDmSections(sections: MutableList<RoomsSection>, activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) {
|
||||
private fun buildDmSections(sections: MutableList<RoomsSection>,
|
||||
activeSpaceAwareQueries: MutableList<RoomListViewModel.ActiveSpaceQueryUpdater>) {
|
||||
if (autoAcceptInvites.showInvites()) {
|
||||
addSection(
|
||||
sections = sections,
|
||||
|
@ -321,7 +326,6 @@ class RoomListSectionBuilderSpace(
|
|||
withQueryParams(
|
||||
{ query.invoke(it) },
|
||||
{ roomQueryParams ->
|
||||
|
||||
val name = stringProvider.getString(nameRes)
|
||||
session.getFilteredPagedRoomSummariesLive(
|
||||
roomQueryParams.process(spaceFilterStrategy, appStateHandler.safeActiveSpaceId()),
|
||||
|
@ -364,7 +368,6 @@ class RoomListSectionBuilderSpace(
|
|||
}
|
||||
}.livePagedList
|
||||
.let { livePagedList ->
|
||||
|
||||
// use it also as a source to update count
|
||||
livePagedList.asObservable()
|
||||
.observeOn(Schedulers.computation())
|
||||
|
|
Loading…
Reference in a new issue