Message editing (#298)

* Add translation for editing mode

* Add `is_editable` flag to timeline item

* Add edit api implementation

* Add edit context menu action

* Add changelog

* Update Rust package

* Add isEditable into video timeline item

* Fix cyclomatic complexity

* Fix video item thumbnail loading

* Fix not updating timeline layout
This commit is contained in:
ismailgulek
2022-11-10 14:41:38 +03:00
committed by GitHub
parent 9f12b34a98
commit 3401d7a7e2
36 changed files with 189 additions and 31 deletions
@@ -98,6 +98,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
timestamp: eventItemProxy.originServerTs.formatted(date: .omitted, time: .shortened),
inGroupState: inGroupState,
isOutgoing: isOutgoing,
isEditable: eventItemProxy.isEditable,
senderId: eventItemProxy.sender,
senderDisplayName: displayName,
senderAvatar: avatarImage,
@@ -114,6 +115,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
timestamp: eventItemProxy.originServerTs.formatted(date: .omitted, time: .shortened),
inGroupState: inGroupState,
isOutgoing: isOutgoing,
isEditable: eventItemProxy.isEditable,
senderId: eventItemProxy.sender,
senderDisplayName: displayName,
senderAvatar: avatarImage,
@@ -134,6 +136,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
timestamp: eventItemProxy.originServerTs.formatted(date: .omitted, time: .shortened),
inGroupState: inGroupState,
isOutgoing: isOutgoing,
isEditable: eventItemProxy.isEditable,
senderId: eventItemProxy.sender,
senderDisplayName: displayName,
senderAvatar: avatarImage,
@@ -155,6 +158,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
timestamp: message.originServerTs.formatted(date: .omitted, time: .shortened),
inGroupState: inGroupState,
isOutgoing: isOutgoing,
isEditable: message.isEditable,
senderId: message.sender,
senderDisplayName: displayName,
senderAvatar: avatarImage,
@@ -178,6 +182,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
timestamp: message.originServerTs.formatted(date: .omitted, time: .shortened),
inGroupState: inGroupState,
isOutgoing: isOutgoing,
isEditable: message.isEditable,
senderId: message.sender,
senderDisplayName: displayName,
senderAvatar: avatarImage,
@@ -207,6 +212,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
timestamp: message.originServerTs.formatted(date: .omitted, time: .shortened),
inGroupState: inGroupState,
isOutgoing: isOutgoing,
isEditable: message.isEditable,
senderId: message.sender,
senderDisplayName: displayName,
senderAvatar: avatarImage,
@@ -236,6 +242,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
timestamp: message.originServerTs.formatted(date: .omitted, time: .shortened),
inGroupState: inGroupState,
isOutgoing: isOutgoing,
isEditable: message.isEditable,
senderId: message.sender,
senderDisplayName: displayName,
senderAvatar: avatarImage,
@@ -257,6 +264,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
timestamp: message.originServerTs.formatted(date: .omitted, time: .shortened),
inGroupState: inGroupState,
isOutgoing: isOutgoing,
isEditable: message.isEditable,
senderId: message.sender,
senderDisplayName: displayName,
senderAvatar: avatarImage,