core: mark accepted and rejected call items read (#704)

This commit is contained in:
Evgeny Poberezkin
2022-05-28 12:34:40 +01:00
committed by GitHub
parent 5e476516cb
commit b56ad77502

View File

@@ -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