Redact event from the bottom sheet

This commit is contained in:
Benoit Marty
2022-11-22 16:37:17 +01:00
parent dd4d2bcd74
commit d44a287933
7 changed files with 55 additions and 6 deletions
@@ -2,7 +2,6 @@ package io.element.android.x.matrix.room
import io.element.android.x.core.coroutine.CoroutineDispatchers
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.core.UserId
import io.element.android.x.matrix.timeline.MatrixTimeline
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
@@ -76,4 +75,11 @@ class MatrixRoom(
room.send(content, transactionId)
}
}
suspend fun redactEvent(eventId: String, reason: String? = null, ) = withContext(coroutineDispatchers.io) {
val transactionId = genTransactionId()
runCatching {
room.redact(eventId, reason, transactionId)
}
}
}