summaryrefslogtreecommitdiff
path: root/IRC.hs
diff options
context:
space:
mode:
Diffstat (limited to 'IRC.hs')
-rw-r--r--IRC.hs10
1 files changed, 5 insertions, 5 deletions
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)