From c337a6888dccf9e2e277417c96f8516adbdd5612 Mon Sep 17 00:00:00 2001 From: JRoberts <8711996+jr-simplex@users.noreply.github.com> Date: Sat, 21 Jan 2023 16:40:24 +0400 Subject: [PATCH] core: delete previous contact calls when receiving a new one (#1812) --- src/Simplex/Chat/Store.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Simplex/Chat/Store.hs b/src/Simplex/Chat/Store.hs index 8d72ab3b8e..be95e5f1c6 100644 --- a/src/Simplex/Chat/Store.hs +++ b/src/Simplex/Chat/Store.hs @@ -4579,8 +4579,9 @@ overwriteSMPServers db User {userId} servers = pure $ Right () createCall :: DB.Connection -> User -> Call -> UTCTime -> IO () -createCall db User {userId} Call {contactId, callId, chatItemId, callState} callTs = do +createCall db user@User {userId} Call {contactId, callId, chatItemId, callState} callTs = do currentTs <- getCurrentTime + deleteCalls db user contactId DB.execute db [sql|