From 5360c5fb69726681609ad48f9364108e5fa11d14 Mon Sep 17 00:00:00 2001 From: pb Date: Tue, 16 Mar 2010 21:02:38 +0000 Subject: git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@36 9f8f72e9-4bf4-416e-b76e-7d4203597157 --- IRC.hs | 7 +++---- 1 file 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) -- cgit v1.2.3