mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-04 06:01:50 +00:00
core: remove logs, remove log for A_DUPLICATE error (#896)
This commit is contained in:
committed by
GitHub
parent
03d9d86aba
commit
7a00a3e324
@@ -440,27 +440,18 @@ processChatCommand = \case
|
||||
withStore' $ \db -> deletePendingContactConnection db userId chatId
|
||||
pure $ CRContactConnectionDeleted conn
|
||||
CTGroup -> do
|
||||
liftIO $ putStrLn "APIDeleteChat CTGroup"
|
||||
Group gInfo@GroupInfo {membership} members <- withStore $ \db -> getGroup db user chatId
|
||||
liftIO $ putStrLn "APIDeleteChat CTGroup: getGroup"
|
||||
let canDelete = memberRole (membership :: GroupMember) == GROwner || not (memberCurrent membership)
|
||||
unless canDelete $ throwChatError CEGroupUserRole
|
||||
liftIO $ putStrLn "APIDeleteChat CTGroup: canDelete"
|
||||
void $ clearGroupContent user gInfo
|
||||
liftIO $ putStrLn "APIDeleteChat CTGroup: clearGroupContent"
|
||||
withChatLock . procCmd $ do
|
||||
when (memberActive membership) . void $ sendGroupMessage gInfo members XGrpDel
|
||||
liftIO $ putStrLn "APIDeleteChat CTGroup: sendGroupMessage"
|
||||
mapM_ deleteMemberConnection members
|
||||
liftIO $ putStrLn "APIDeleteChat CTGroup: deleteMemberConnection"
|
||||
-- two functions below are called in separate transactions to prevent crashes on android
|
||||
-- (possibly, race condition on integrity check?)
|
||||
withStore' $ \db -> deleteGroupConnectionsAndFiles db user gInfo members
|
||||
liftIO $ putStrLn "APIDeleteChat CTGroup: deleteGroupConnectionsAndFiles"
|
||||
withStore' $ \db -> deleteGroupItemsAndMembers db user gInfo
|
||||
liftIO $ putStrLn "APIDeleteChat CTGroup: deleteGroupItemsAndMembers"
|
||||
withStore' $ \db -> deleteGroup db user gInfo
|
||||
liftIO $ putStrLn "APIDeleteChat CTGroup: deleteGroup"
|
||||
pure $ CRGroupDeletedUser gInfo
|
||||
CTContactRequest -> pure $ chatCmdError "not supported"
|
||||
APIClearChat (ChatRef cType chatId) -> withUser $ \user@User {userId} -> case cType of
|
||||
|
||||
Reference in New Issue
Block a user