diff options
| author | pb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157> | 2010-03-16 21:02:38 +0000 |
|---|---|---|
| committer | pb <pb@9f8f72e9-4bf4-416e-b76e-7d4203597157> | 2010-03-16 21:02:38 +0000 |
| commit | 5360c5fb69726681609ad48f9364108e5fa11d14 (patch) | |
| tree | 69cd388e549092624b9e943300f528f1f6b91f64 | |
| parent | eb9535febeb8c4f87473773ef7d9bec9a2ffd76d (diff) | |
git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@36 9f8f72e9-4bf4-416e-b76e-7d4203597157
| -rw-r--r-- | IRC.hs | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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) |
