mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-31 01:05:55 +00:00
add logs to deleteContact
This commit is contained in:
@@ -2137,9 +2137,9 @@ withStore ::
|
||||
m a
|
||||
withStore action =
|
||||
asks chatStore
|
||||
>>= runExceptT . action
|
||||
-- >>= runExceptT . action
|
||||
-- use this line instead of above to log query errors
|
||||
-- >>= (\st -> runExceptT $ action st `E.catch` \(e :: E.SomeException) -> liftIO (print e) >> E.throwIO e)
|
||||
>>= (\st -> runExceptT $ action st `E.catch` \(e :: E.SomeException) -> liftIO (print e) >> E.throwIO e)
|
||||
>>= liftEither . first ChatErrorStore
|
||||
|
||||
chatCommandP :: Parser ChatCommand
|
||||
|
||||
@@ -428,8 +428,10 @@ getContactGroupNames st userId Contact {contactId} =
|
||||
(userId, contactId)
|
||||
|
||||
deleteContact :: MonadUnliftIO m => SQLiteStore -> UserId -> Contact -> m ()
|
||||
deleteContact st userId Contact {contactId, localDisplayName} =
|
||||
deleteContact st userId Contact {contactId, localDisplayName} = do
|
||||
liftIO $ putStrLn "in deleteContact, liftIO . withTransaction st $ \\db -> do"
|
||||
liftIO . withTransaction st $ \db -> do
|
||||
liftIO $ putStrLn "DB.execute DELETE FROM connections WHERE connection_id IN ..."
|
||||
DB.execute
|
||||
db
|
||||
[sql|
|
||||
@@ -441,7 +443,9 @@ deleteContact st userId Contact {contactId, localDisplayName} =
|
||||
)
|
||||
|]
|
||||
(userId, contactId)
|
||||
liftIO $ putStrLn "DB.execute db \"DELETE FROM contacts WHERE user_id = ? AND contact_id = ?\" (userId, contactId)"
|
||||
DB.execute db "DELETE FROM contacts WHERE user_id = ? AND contact_id = ?" (userId, contactId)
|
||||
liftIO $ putStrLn "DB.execute db \"DELETE FROM display_names WHERE user_id = ? AND local_display_name = ?\" (userId, localDisplayName)"
|
||||
DB.execute db "DELETE FROM display_names WHERE user_id = ? AND local_display_name = ?" (userId, localDisplayName)
|
||||
|
||||
updateUserProfile :: StoreMonad m => SQLiteStore -> User -> Profile -> m ()
|
||||
|
||||
Reference in New Issue
Block a user