diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-21 20:04:22 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-21 20:04:22 +0100 |
commit | f612d03ac7d5fb00fa76c3be14d965ab51988504 (patch) | |
tree | 662fc16c3a35a76c3f4c114d4860ff82745f27f9 /main/Test.hs | |
parent | 652365ffb1c71b5758329c17015cb5c1912da1f4 (diff) | |
parent | 68648650527b769c6ed9f4d3e45aad86187b12b9 (diff) |
Merge branch 'release-0.1'
Diffstat (limited to 'main/Test.hs')
-rw-r--r-- | main/Test.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/Test.hs b/main/Test.hs index 550e47f..570dd5d 100644 --- a/main/Test.hs +++ b/main/Test.hs @@ -289,6 +289,7 @@ commands = map (T.pack *** id) , ("dm-list-peer", cmdDmListPeer) , ("dm-list-contact", cmdDmListContact) , ("chatroom-create", cmdChatroomCreate) + , ("chatroom-delete", cmdChatroomDelete) , ("chatroom-list-local", cmdChatroomListLocal) , ("chatroom-watch-local", cmdChatroomWatchLocal) , ("chatroom-set-name", cmdChatroomSetName) @@ -774,6 +775,13 @@ cmdChatroomCreate = do room <- createChatroom (Just name) Nothing cmdOut $ unwords $ "chatroom-create-done" : chatroomInfo room +cmdChatroomDelete :: Command +cmdChatroomDelete = do + [ cid ] <- asks tiParams + sdata <- getChatroomStateData cid + deleteChatroomByStateData sdata + cmdOut $ unwords [ "chatroom-delete-done", T.unpack cid ] + getChatroomStateData :: Text -> CommandM (Stored ChatroomStateData) getChatroomStateData tref = do st <- asks tiStorage |