mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:05:28 +00:00
Simplify the management of inReplyToEventTimelineItem
This commit is contained in:
-2
@@ -91,8 +91,6 @@ interface MatrixRoom : Closeable {
|
||||
|
||||
suspend fun enterReplyMode(eventId: EventId): Result<Unit>
|
||||
|
||||
suspend fun exitReplyMode(): Result<Unit>
|
||||
|
||||
suspend fun replyMessage(eventId: EventId, body: String, htmlBody: String?): Result<Unit>
|
||||
|
||||
suspend fun redactEvent(eventId: EventId, reason: String? = null): Result<Unit>
|
||||
|
||||
+1
-7
@@ -139,6 +139,7 @@ class RustMatrixRoom(
|
||||
roomCoroutineScope.cancel()
|
||||
innerRoom.destroy()
|
||||
roomListItem.destroy()
|
||||
inReplyToEventTimelineItem?.destroy()
|
||||
}
|
||||
|
||||
override val name: String?
|
||||
@@ -272,13 +273,6 @@ class RustMatrixRoom(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun exitReplyMode(): Result<Unit> = withContext(roomDispatcher) {
|
||||
runCatching {
|
||||
inReplyToEventTimelineItem?.destroy()
|
||||
inReplyToEventTimelineItem = null
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun replyMessage(eventId: EventId, body: String, htmlBody: String?): Result<Unit> = withContext(roomDispatcher) {
|
||||
runCatching {
|
||||
val inReplyTo = inReplyToEventTimelineItem ?: innerRoom.getEventTimelineItemByEventId(eventId.value)
|
||||
|
||||
-4
@@ -212,10 +212,6 @@ class FakeMatrixRoom(
|
||||
return Result.success(Unit)
|
||||
}
|
||||
|
||||
override suspend fun exitReplyMode(): Result<Unit> {
|
||||
return Result.success(Unit)
|
||||
}
|
||||
|
||||
override suspend fun replyMessage(eventId: EventId, body: String, htmlBody: String?): Result<Unit> {
|
||||
replyMessageParameter = body to htmlBody
|
||||
return Result.success(Unit)
|
||||
|
||||
Reference in New Issue
Block a user