summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/Main.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/Main.hs b/main/Main.hs
index 394cd30..dfa3e1b 100644
--- a/main/Main.hs
+++ b/main/Main.hs
@@ -526,7 +526,13 @@ cmdSelectContext :: Command
cmdSelectContext = do
n <- read <$> asks ciLine
join (asks ciContextOptions) >>= \ctxs -> if
- | n > 0, (ctx : _) <- drop (n - 1) ctxs -> modify $ \s -> s { csContext = ctx }
+ | n > 0, (ctx : _) <- drop (n - 1) ctxs -> do
+ modify $ \s -> s { csContext = ctx }
+ case ctx of
+ SelectedChatroom rstate -> do
+ when (not (roomStateSubscribe rstate)) $ do
+ chatroomSetSubscribe (head $ roomStateData rstate) True
+ _ -> return ()
| otherwise -> throwError "invalid index"
cmdSend :: Command