summaryrefslogtreecommitdiff
path: root/main/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'main/Main.hs')
-rw-r--r--main/Main.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/Main.hs b/main/Main.hs
index 32c226f..73def51 100644
--- a/main/Main.hs
+++ b/main/Main.hs
@@ -502,6 +502,7 @@ commands =
, ("ice-send", cmdIceSend)
#endif
, ("join", cmdJoin)
+ , ("join-as", cmdJoinAs)
, ("leave", cmdLeave)
, ("members", cmdMembers)
, ("select", cmdSelectContext)
@@ -570,6 +571,13 @@ showPeer pidentity paddr =
cmdJoin :: Command
cmdJoin = joinChatroom =<< getSelectedChatroom
+cmdJoinAs :: Command
+cmdJoinAs = do
+ name <- asks ciLine
+ st <- getStorage
+ identity <- liftIO $ createIdentity st (Just $ T.pack name) Nothing
+ joinChatroomAs identity =<< getSelectedChatroom
+
cmdLeave :: Command
cmdLeave = leaveChatroom =<< getSelectedChatroom