mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-22 10:07:31 +00:00
core, ui: chatItemUpdated event has the previous item (#8219)
* core, ui: chatItemUpdated event has the previous item Apps change counters by the difference between the previous and the new item, and insert an updated item only when the update created it. * core, ui: a recreated item is sent as newChatItems An update of a locally deleted message creates it again and sends it as a new item, so chatItemUpdated always has the previous item and the apps never insert on an update. * core, ui: previous item is optional and has no chat info Events from older remote hosts decode without it; the apps then insert the item if it is not loaded and change no counters. * core: catch-up subscriber gets an edited history post as a new item * ui: updates in another profile do not notify, as on iOS * core, ui: one type for the updated item and its previous version AChatItemUpdate has the chat info, the new item and the previous item with the same chat type and direction. Its JSON is the JSON of AChatItem with an optional prevChatItem; the event keeps the key chatItem. * core: tested event key, previous item reactions, cleared mentions One function renames the event field to chatItem for JSON and docs, and the test checks the wire key and compatibility with AChatItem. The previous item of a direct edit has its reactions. An edit that removes all mentions sends the item without them. * core: test that an edit removing mentions sends the item without them * core: event JSON field mapping inline in the TH options, for the Windows build * core: file chat item update checked in one store transaction * core: test that a file reset by unknown relays sends its previous item * core, ui: chatItemUpdated event key chatItemUpdate * core, ui: chatItemUpdated always has the previous item * ci: mcp scope tests the plugin with its published dependencies * core: mention of the user follows edits of a group message * core: previous item of a prohibited file is read before the prohibition * android, desktop: missed call check inline, counter test with core pairs * ios: spec link of the chatItemUpdated event * core: mention edits in support chats update members requiring attention * core: one rule for the mention of the user in received and edited items * core: record item events of updates for app tests * android, desktop: remove the missed call notification of updates, never shown * android, desktop: test item updates on events recorded by the core * ios: test item updates on events recorded by the core * docs: plan of app tests of item updates, recording tests in the CI guide * core: record the response to an update after its item status is final * ios: notification manager replaceable in tests * ios: test notifications of updates and the update response * android, desktop: test the recorded update response * docs: plan with iOS notifications and the update response * core: recorded response to an update of a sent message
This commit is contained in:
1 parent
dabee7dab8
commit
4eeddce11d
50 files changed
+4641
-184
No files matched your search
@@ -76,7 +76,7 @@ chatEventsDocsData =
|
||||
],
|
||||
[ ("CEvtChatItemReaction", "Received message reaction."),
|
||||
("CEvtChatItemsDeleted", "Message was deleted by another user."),
|
||||
("CEvtChatItemUpdated", "Message was updated by another user."),
|
||||
("CEvtChatItemUpdated", "Message was updated by another user.\n\n`chatItemUpdate` has `prevChatItem`, the message before the update. When the bot deleted the message locally, the update creates it again, and it is sent in [NewChatItems](#newchatitems) event."),
|
||||
("CEvtGroupChatItemsDeleted", "Group messages are deleted or moderated."),
|
||||
("CEvtChatItemsStatusesUpdated", "Message delivery status updates.")
|
||||
]
|
||||
|
||||
@@ -205,6 +205,7 @@ chatTypesDocsData =
|
||||
((sti @JSONCIStatus) {typeName = "CIStatus"}, STUnion, "JCIS", [], "", ""),
|
||||
(ciQuoteType, STRecord, "", [], "", ""),
|
||||
(STI "AChatItem" [RecordTypeInfo "AChatItem" [FieldInfo "chatInfo" (ti "ChatInfo"), FieldInfo "chatItem" (ti "ChatItem")]], STRecord, "", [], "", ""),
|
||||
(STI "AChatItemUpdate" [RecordTypeInfo "AChatItemUpdate" [FieldInfo "chatInfo" (ti "ChatInfo"), FieldInfo "chatItem" (ti "ChatItem"), FieldInfo "prevChatItem" (ti "ChatItem")]], STRecord, "", [], "", "Updated message, with the message before the update."),
|
||||
(STI "ACIReaction" [RecordTypeInfo "ACIReaction" [FieldInfo "chatInfo" (ti "ChatInfo"), FieldInfo "chatReaction" (ti "CIReaction")]], STRecord, "", [], "", ""),
|
||||
-- (STI "JSONObject" [], STRecord, "", [], "Arbitrary JSON object."),
|
||||
-- (STI "UTCTime" [], STRecord, "", [], "Timestampe in ISO8601 format as string."),
|
||||
|
||||
Reference in new issue
Block a user