summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IRC.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/IRC.hs b/IRC.hs
index 68d71f6..a3a4677 100644
--- a/IRC.hs
+++ b/IRC.hs
@@ -85,14 +85,13 @@ ircEvalLoop h env = forever $ do
pong x = ircWrite h "PONG" (':' : drop 6 x)
ircEval :: Handle -> IrcMessage -> Env -> IO ()
-ircEval h msg env@(DispatchEnv state conf dispatch) =
+ircEval h msg env@(DispatchEnv state _ dispatch) =
case isCommand (clean msg) of
- Just cmd -> dispatch cmd sendReplyMsg envWoDispatch
+ Just cmd -> dispatch cmd sendReplyMsg (castEnv env)
Nothing -> evalServerMessage (clean msg)
where
- envWoDispatch = (Env state conf)
isCommand ('!':xs) = Just xs
isCommand _ = Nothing
evalServerMessage "+x" = ircWrite h "JOIN" (currentChannel state)
evalServerMessage _ = putStrLn $ show msg
- sendReplyMsg = ircPrivMsg h msg envWoDispatch
+ sendReplyMsg = ircPrivMsg h msg (castEnv env)