mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-30 20:45:49 +00:00
core: add delete group logs (#879)
This commit is contained in:
committed by
GitHub
parent
7a03f87822
commit
9e210256d2
@@ -1343,16 +1343,25 @@ getGroup db user groupId = do
|
||||
|
||||
deleteGroupConnectionsAndFiles :: DB.Connection -> UserId -> Group -> IO ()
|
||||
deleteGroupConnectionsAndFiles db userId (Group GroupInfo {groupId} members) = do
|
||||
print "deleteGroupConnectionsAndFiles"
|
||||
forM_ members $ \m -> DB.execute db "DELETE FROM connections WHERE user_id = ? AND group_member_id = ?" (userId, groupMemberId' m)
|
||||
print "deleteGroupConnectionsAndFiles: connections"
|
||||
DB.execute db "DELETE FROM files WHERE user_id = ? AND group_id = ?" (userId, groupId)
|
||||
print "deleteGroupConnectionsAndFiles: files"
|
||||
|
||||
deleteGroup :: DB.Connection -> User -> Group -> IO ()
|
||||
deleteGroup db User {userId} (Group GroupInfo {groupId, localDisplayName} _) = do
|
||||
print "deleteGroup"
|
||||
DB.execute db "DELETE FROM chat_items WHERE user_id = ? AND group_id = ?" (userId, groupId)
|
||||
print "deleteGroup: chat_items"
|
||||
DB.execute db "DELETE FROM group_members WHERE user_id = ? AND group_id = ?" (userId, groupId)
|
||||
print "deleteGroup: group_members"
|
||||
deleteGroupProfile_ db userId groupId
|
||||
print "deleteGroup: deleteGroupProfile_"
|
||||
DB.execute db "DELETE FROM groups WHERE user_id = ? AND group_id = ?" (userId, groupId)
|
||||
print "deleteGroup: groups"
|
||||
DB.execute db "DELETE FROM display_names WHERE user_id = ? AND local_display_name = ?" (userId, localDisplayName)
|
||||
print "deleteGroup: display_names"
|
||||
|
||||
deleteGroupProfile_ :: DB.Connection -> UserId -> GroupId -> IO ()
|
||||
deleteGroupProfile_ db userId groupId =
|
||||
|
||||
Reference in New Issue
Block a user