space service : expose methods from sdk

This commit is contained in:
ganfra 2025-12-23 20:49:41 +01:00
parent 421f12f396
commit b59e36aabd
3 changed files with 33 additions and 4 deletions

View file

@ -51,13 +51,28 @@ class RustSpaceService(
override suspend fun joinedSpaces(): Result<List<SpaceRoom>> = withContext(sessionDispatcher) {
runCatchingExceptions {
innerSpaceService.topLevelJoinedSpaces()
.map {
it.let(spaceRoomMapper::map)
}
innerSpaceService
.topLevelJoinedSpaces()
.map(spaceRoomMapper::map)
}
}
override suspend fun joinedParents(spaceId: RoomId): Result<List<SpaceRoom>> = withContext(sessionDispatcher) {
runCatchingExceptions {
innerSpaceService
.joinedParentsOfChild(spaceId.value)
.map(spaceRoomMapper::map)
}
}
override suspend fun getSpaceRoom(spaceId: RoomId): SpaceRoom? = withContext(sessionDispatcher) {
runCatchingExceptions {
innerSpaceService.getSpaceRoom(spaceId.value)?.let { spaceRoom ->
spaceRoomMapper.map(spaceRoom)
}
}.getOrNull()
}
override fun spaceRoomList(id: RoomId): SpaceRoomList {
val childCoroutineScope = sessionCoroutineScope.childScope(sessionDispatcher, "SpaceRoomListScope-$this")
return RustSpaceRoomList(