mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Add support for editing local echoes.
This commit is contained in:
@@ -180,7 +180,9 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
|
|
||||||
if enabled == false, reachability == .reachable {
|
if enabled == false, reachability == .reachable {
|
||||||
MXLog.info("Enabling all send queues")
|
MXLog.info("Enabling all send queues")
|
||||||
client.enableAllSendQueues(enable: true)
|
Task {
|
||||||
|
await client.enableAllSendQueues(enable: true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.store(in: &cancellables)
|
.store(in: &cancellables)
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ final class TimelineProxy: TimelineProxyProtocol {
|
|||||||
intentionalMentions: IntentionalMentions) async -> Result<Void, TimelineProxyError> {
|
intentionalMentions: IntentionalMentions) async -> Result<Void, TimelineProxyError> {
|
||||||
MXLog.info("Editing timeline item: \(timelineItemID)")
|
MXLog.info("Editing timeline item: \(timelineItemID)")
|
||||||
|
|
||||||
guard let eventID = timelineItemID.eventID else {
|
guard let eventTimelineItem = await timelineProvider.itemProxies.firstEventTimelineItemUsingID(timelineItemID) else {
|
||||||
MXLog.error("Missing event ID")
|
MXLog.error("Unknown timeline item: \(timelineItemID)")
|
||||||
return .failure(.failedEditing)
|
return .failure(.failedEditing)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +168,9 @@ final class TimelineProxy: TimelineProxyProtocol {
|
|||||||
intentionalMentions: intentionalMentions.toRustMentions())
|
intentionalMentions: intentionalMentions.toRustMentions())
|
||||||
|
|
||||||
do {
|
do {
|
||||||
try await timeline.edit(newContent: messageContent, eventId: eventID)
|
guard try await timeline.edit(item: eventTimelineItem, newContent: messageContent) == true else {
|
||||||
|
return .failure(.failedEditing)
|
||||||
|
}
|
||||||
|
|
||||||
MXLog.info("Finished editing timeline item: \(timelineItemID)")
|
MXLog.info("Finished editing timeline item: \(timelineItemID)")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user