core: check item status is not already SndRcvd before updating to SndSent (#2708)

This commit is contained in:
spaced4ndy
2023-07-17 15:25:32 +04:00
committed by GitHub
parent d3b5bbe566
commit 938bd56c3a
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -2870,6 +2870,7 @@ processAgentMessageConn user@User {userId} corrId agentConnId agentMessage = do
sentMsgDeliveryEvent conn msgId
checkSndInlineFTComplete conn msgId
withStore' (\db -> getDirectChatItemByAgentMsgId db user contactId connId msgId) >>= \case
Just (CChatItem SMDSnd ChatItem {meta = CIMeta {itemStatus = CISSndRcvd _}}) -> pure ()
Just (CChatItem SMDSnd ci) -> do
chatItem <- withStore $ \db -> updateDirectChatItemStatus db user contactId (chatItemId' ci) CISSndSent
toView $ CRChatItemStatusUpdated user (AChatItem SCTDirect SMDSnd (DirectChat ct) chatItem)