Ensure editMessage, enterSpecialMode and replyMessage are called on the current timeline.

This commit is contained in:
Benoit Marty
2024-04-29 15:50:56 +02:00
parent 16bdd34a80
commit 6b8552fac1
3 changed files with 0 additions and 50 deletions

View File

@@ -131,12 +131,6 @@ interface MatrixRoom : Closeable {
suspend fun sendMessage(body: String, htmlBody: String?, mentions: List<Mention>): Result<Unit>
suspend fun editMessage(originalEventId: EventId?, transactionId: TransactionId?, body: String, htmlBody: String?, mentions: List<Mention>): Result<Unit>
suspend fun enterSpecialMode(eventId: EventId?): Result<Unit>
suspend fun replyMessage(eventId: EventId, body: String, htmlBody: String?, mentions: List<Mention>): Result<Unit>
suspend fun redactEvent(eventId: EventId, reason: String? = null): Result<Unit>
suspend fun sendImage(

View File

@@ -326,24 +326,6 @@ class RustMatrixRoom(
return liveTimeline.sendMessage(body, htmlBody, mentions)
}
override suspend fun editMessage(
originalEventId: EventId?,
transactionId: TransactionId?,
body: String,
htmlBody: String?,
mentions: List<Mention>,
): Result<Unit> {
return liveTimeline.editMessage(originalEventId, transactionId, body, htmlBody, mentions)
}
override suspend fun enterSpecialMode(eventId: EventId?): Result<Unit> {
return liveTimeline.enterSpecialMode(eventId)
}
override suspend fun replyMessage(eventId: EventId, body: String, htmlBody: String?, mentions: List<Mention>): Result<Unit> {
return liveTimeline.replyMessage(eventId, body, htmlBody, mentions)
}
override suspend fun redactEvent(eventId: EventId, reason: String?) = withContext(roomDispatcher) {
runCatching {
innerRoom.redact(eventId.value, reason)

View File

@@ -134,7 +134,6 @@ class FakeMatrixRoom(
private var updatePowerLevelsResult = Result.success(Unit)
private var resetPowerLevelsResult = Result.success(defaultRoomPowerLevels())
var sendMessageMentions = emptyList<Mention>()
val editMessageCalls = mutableListOf<Pair<String, String?>>()
private val _typingRecord = mutableListOf<Boolean>()
val typingRecord: List<Boolean>
get() = _typingRecord
@@ -296,31 +295,6 @@ class FakeMatrixRoom(
return eventPermalinkResult(eventId)
}
override suspend fun editMessage(
originalEventId: EventId?,
transactionId: TransactionId?,
body: String,
htmlBody: String?,
mentions: List<Mention>
): Result<Unit> {
sendMessageMentions = mentions
editMessageCalls += body to htmlBody
return Result.success(Unit)
}
var replyMessageParameter: Pair<String, String?>? = null
private set
override suspend fun enterSpecialMode(eventId: EventId?): Result<Unit> {
return Result.success(Unit)
}
override suspend fun replyMessage(eventId: EventId, body: String, htmlBody: String?, mentions: List<Mention>): Result<Unit> {
sendMessageMentions = mentions
replyMessageParameter = body to htmlBody
return Result.success(Unit)
}
var redactEventEventIdParam: EventId? = null
private set