mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Some clean up on room details
This commit is contained in:
+1
-1
@@ -56,5 +56,5 @@ interface MatrixRoom: Closeable {
|
||||
|
||||
suspend fun redactEvent(eventId: EventId, reason: String? = null): Result<Unit>
|
||||
|
||||
fun leave(): Result<Unit>
|
||||
suspend fun leave(): Result<Unit>
|
||||
}
|
||||
|
||||
+5
-2
@@ -88,6 +88,7 @@ class RustMatrixRoom(
|
||||
coroutineDispatchers = coroutineDispatchers
|
||||
)
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
innerRoom.destroy()
|
||||
slidingSyncRoom.destroy()
|
||||
@@ -183,7 +184,9 @@ class RustMatrixRoom(
|
||||
}
|
||||
}
|
||||
|
||||
override fun leave(): Result<Unit> {
|
||||
return runCatching { innerRoom.leave() }
|
||||
override suspend fun leave(): Result<Unit> = withContext(coroutineDispatchers.io) {
|
||||
runCatching {
|
||||
innerRoom.leave()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ class FakeMatrixRoom(
|
||||
return Result.success(Unit)
|
||||
}
|
||||
|
||||
override fun leave(): Result<Unit> = leaveRoomError?.let { Result.failure(it) } ?: Result.success(Unit)
|
||||
override suspend fun leave(): Result<Unit> = leaveRoomError?.let { Result.failure(it) } ?: Result.success(Unit)
|
||||
|
||||
override fun close() = Unit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user