From df5f62ab71f56722bdeca8e77c78ab1d7aeeeb24 Mon Sep 17 00:00:00 2001 From: pb Date: Tue, 16 Mar 2010 20:56:57 +0000 Subject: git-svn-id: https://ssl.buetow.org/repos/hsbot/trunk@34 9f8f72e9-4bf4-416e-b76e-7d4203597157 --- IRC.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'IRC.hs') diff --git a/IRC.hs b/IRC.hs index fc32d9b..68d71f6 100644 --- a/IRC.hs +++ b/IRC.hs @@ -26,7 +26,7 @@ ircWrite h s t = do hPrintf h "%s %s\r\n" s t ircPrivMsg :: Handle -> IrcMessage -> Env -> String -> IO () -ircPrivMsg h msg (EnvWoDispatch state conf) s = do +ircPrivMsg h msg (Env state conf) s = do if isMultiline s then ircPrivMsg' (lines s) else ircPrivMsg' [s] @@ -52,7 +52,7 @@ ircPrivMsg h msg (EnvWoDispatch state conf) s = do ircPrivMsg' xs ircConnect :: Env -> IO () -ircConnect (Env state conf dispatch) = do +ircConnect (DispatchEnv state conf dispatch) = do ircChannel <- get "ircChannel" conf ircNick <- get "ircNick" conf ircPort <- get "ircPort" conf @@ -62,7 +62,7 @@ ircConnect (Env state conf dispatch) = do hSetBuffering h NoBuffering ircWrite h "NICK" ircNick ircWrite h "USER" $ ircNick ++ " 0 * :" ++ ircUser - ircEvalLoop h (Env state { currentChannel = ircChannel } conf dispatch) + ircEvalLoop h (DispatchEnv state { currentChannel = ircChannel } conf dispatch) ircEvalLoop :: Handle -> Env -> IO () ircEvalLoop h env = forever $ do @@ -85,12 +85,12 @@ ircEvalLoop h env = forever $ do pong x = ircWrite h "PONG" (':' : drop 6 x) ircEval :: Handle -> IrcMessage -> Env -> IO () -ircEval h msg env@(Env state conf dispatch) = +ircEval h msg env@(DispatchEnv state conf dispatch) = case isCommand (clean msg) of Just cmd -> dispatch cmd sendReplyMsg envWoDispatch Nothing -> evalServerMessage (clean msg) where - envWoDispatch = (EnvWoDispatch state conf) + envWoDispatch = (Env state conf) isCommand ('!':xs) = Just xs isCommand _ = Nothing evalServerMessage "+x" = ircWrite h "JOIN" (currentChannel state) -- cgit v1.2.3