Fix editing items not in the timeline failing (#3075)

This commit is contained in:
Mauro
2024-07-22 13:15:57 +02:00
committed by GitHub
parent ab49274015
commit ff33c07596
10 changed files with 307 additions and 72 deletions
@@ -336,6 +336,16 @@ class RoomProxy: RoomProxyProtocol {
}
}
func edit(eventID: String, newContent: RoomMessageEventContentWithoutRelation) async -> Result<Void, RoomProxyError> {
do {
try await room.edit(eventId: eventID, newContent: newContent)
return .success(())
} catch {
MXLog.error("Failed editing event id \(eventID), in room \(id) with error: \(error)")
return .failure(.sdkError(error))
}
}
func sendTypingNotification(isTyping: Bool) async -> Result<Void, RoomProxyError> {
MXLog.info("Sending typing notification isTyping: \(isTyping)")
@@ -96,6 +96,8 @@ protocol RoomProxyProtocol {
func markAsRead(receiptType: ReceiptType) async -> Result<Void, RoomProxyError>
func edit(eventID: String, newContent: RoomMessageEventContentWithoutRelation) async -> Result<Void, RoomProxyError>
/// https://spec.matrix.org/v1.9/client-server-api/#typing-notifications
@discardableResult func sendTypingNotification(isTyping: Bool) async -> Result<Void, RoomProxyError>