Fix a potential race condition when redacting a message. (#3061)

* Refactor the timeline item menu action provider.

- Move it into its own struct.
- Use an item, not an ID so it doesn't randomly change.
- Move permissions into the room screen view model.

* Use the stable ID when redacting/editing/forwarding a message.

Just like we do when fetching the item in the actions menu.
This commit is contained in:
Doug
2024-07-18 15:14:38 +01:00
committed by GitHub
parent 2fb7f65957
commit 6339fe2bf0
12 changed files with 337 additions and 275 deletions
@@ -20,3 +20,10 @@ import UIKit
protocol RoomTimelineItemProtocol {
var id: TimelineItemIdentifier { get }
}
extension RoomTimelineItemProtocol {
var isReactable: Bool {
guard let eventItem = self as? EventBasedTimelineItemProtocol else { return false }
return !eventItem.isRedacted && !eventItem.hasFailedToSend && !eventItem.hasFailedDecryption
}
}