Some cleanup

This commit is contained in:
Benoit Marty 2022-09-06 11:36:44 +02:00
parent 9347bc8cf4
commit 3c7889c95d
4 changed files with 3 additions and 4 deletions

View File

@ -34,5 +34,4 @@ data class SpaceChildInfo(
val canonicalAlias: String?,
val aliases: List<String>?,
val worldReadable: Boolean
)

View File

@ -80,7 +80,7 @@ interface SpaceService {
/**
* Get a live list of space summaries. This list is refreshed as soon as the data changes.
* @return the [LiveData] of List[SpaceSummary]
* @return the [LiveData] of List[RoomSummary]
*/
fun getSpaceSummariesLive(
queryParams: SpaceSummaryQueryParams,

View File

@ -255,7 +255,7 @@ internal class DefaultSpaceService @Inject constructor(
stateKey = QueryStringValue.IsEmpty
)
val powerLevelsContent = powerLevelsEvent?.content?.toModel<PowerLevelsContent>()
?: throw UnsupportedOperationException("Cannot add canonical child, missing powerlevel")
?: throw UnsupportedOperationException("Cannot add canonical child, missing power level")
val powerLevelsHelper = PowerLevelsHelper(powerLevelsContent)
if (!powerLevelsHelper.isUserAllowedToSend(userId, true, EventType.STATE_SPACE_CHILD)) {
throw UnsupportedOperationException("Cannot add canonical child, not enough power level")

View File

@ -189,7 +189,7 @@ class SpaceManageRoomsViewModel @AssistedInject constructor(
val apiResult = session.spaceService().querySpaceChildren(
spaceId = initialState.spaceId,
from = nextToken,
knownStateList = knownResults.childrenState.orEmpty(),
knownStateList = knownResults.childrenState,
limit = paginationLimit
)
val newKnown = apiResult.children.mapNotNull { session.getRoomSummary(it.childRoomId) }