summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-16 21:02:38 +0000
committerpb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157>2010-03-16 21:02:38 +0000
commit5360c5fb69726681609ad48f9364108e5fa11d14 (patch)
tree69cd388e549092624b9e943300f528f1f6b91f64
parenteb9535febeb8c4f87473773ef7d9bec9a2ffd76d (diff)
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@36 9f8f72e9-4bf4-416e-b76e-7d4203597157
-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)