diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 95ab009c3f..377d27552c 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -470,9 +470,10 @@ processChatCommand = \case APIRejectCall contactId -> -- party accepting call withCurrentCall contactId $ \userId ct Call {chatItemId, callState} -> case callState of - CallInvitationReceived {} -> + CallInvitationReceived {} -> do let aciContent = ACIContent SMDRcv $ CIRcvCall CISCallRejected 0 - in updateDirectChatItemView userId ct chatItemId aciContent Nothing $> Nothing + withStore $ \st -> updateDirectChatItemsRead st contactId $ Just (chatItemId, chatItemId) + updateDirectChatItemView userId ct chatItemId aciContent Nothing $> Nothing _ -> throwChatError . CECallState $ callStateTag callState APISendCallOffer contactId WebRTCCallOffer {callType, rtcSession} -> -- party accepting call @@ -483,6 +484,7 @@ processChatCommand = \case callState' = CallOfferSent {localCallType = callType, peerCallType, localCallSession = rtcSession, sharedKey} aciContent = ACIContent SMDRcv $ CIRcvCall CISCallAccepted 0 SndMessage {msgId} <- sendDirectContactMessage ct (XCallOffer callId offer) + withStore $ \st -> updateDirectChatItemsRead st contactId $ Just (chatItemId, chatItemId) updateDirectChatItemView userId ct chatItemId aciContent $ Just msgId pure $ Just call {callState = callState'} _ -> throwChatError . CECallState $ callStateTag callState