core: notify about contact deletion only if contact is ready, catch errors (#3160)
This commit is contained in:
parent
8545a1e8f9
commit
d4cbef1ba1
@ -897,7 +897,8 @@ processChatCommand = \case
|
|||||||
filesInfo <- withStore' $ \db -> getContactFileInfo db user ct
|
filesInfo <- withStore' $ \db -> getContactFileInfo db user ct
|
||||||
withChatLock "deleteChat direct" . procCmd $ do
|
withChatLock "deleteChat direct" . procCmd $ do
|
||||||
deleteFilesAndConns user filesInfo
|
deleteFilesAndConns user filesInfo
|
||||||
when (contactActive ct && notify) . void $ sendDirectContactMessage ct XDirectDel
|
when (isReady ct && contactActive ct && notify) $
|
||||||
|
void (sendDirectContactMessage ct XDirectDel) `catchChatError` const (pure ())
|
||||||
contactConnIds <- map aConnId <$> withStore (\db -> getContactConnections db userId ct)
|
contactConnIds <- map aConnId <$> withStore (\db -> getContactConnections db userId ct)
|
||||||
deleteAgentConnectionsAsync user contactConnIds
|
deleteAgentConnectionsAsync user contactConnIds
|
||||||
-- functions below are called in separate transactions to prevent crashes on android
|
-- functions below are called in separate transactions to prevent crashes on android
|
||||||
|
Loading…
Reference in New Issue
Block a user