Add a way to clear the cache for a specific room.
This commit is contained in:
parent
0d2efe5ffa
commit
4f1c745fc8
8 changed files with 45 additions and 1 deletions
|
|
@ -232,6 +232,11 @@ interface MatrixRoom : Closeable {
|
|||
*/
|
||||
suspend fun setUnreadFlag(isUnread: Boolean): Result<Unit>
|
||||
|
||||
/**
|
||||
* Clear the event cache storage for the current room.
|
||||
*/
|
||||
suspend fun clearEventCacheStorage(): Result<Unit>
|
||||
|
||||
/**
|
||||
* Share a location message in the room.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -569,6 +569,12 @@ class RustMatrixRoom(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun clearEventCacheStorage(): Result<Unit> = withContext(roomDispatcher) {
|
||||
runCatching {
|
||||
innerRoom.clearEventCacheStorage()
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun kickUser(userId: UserId, reason: String?): Result<Unit> = withContext(roomDispatcher) {
|
||||
runCatching {
|
||||
innerRoom.kickUser(userId.value, reason)
|
||||
|
|
|
|||
|
|
@ -574,6 +574,10 @@ class FakeMatrixRoom(
|
|||
fun givenRoomMembersState(state: MatrixRoomMembersState) {
|
||||
membersStateFlow.value = state
|
||||
}
|
||||
|
||||
override suspend fun clearEventCacheStorage(): Result<Unit> {
|
||||
return Result.success(Unit)
|
||||
}
|
||||
}
|
||||
|
||||
fun defaultRoomPowerLevels() = MatrixRoomPowerLevels(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue