From 53870767c32f61f756861d7bf18b5a55cd45a2e2 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 4 Feb 2010 20:55:54 +0100 Subject: Rewrote command handling, added the Quote module and cleaned input handling. --- Hsbot/IRC.hs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'Hsbot/IRC.hs') diff --git a/Hsbot/IRC.hs b/Hsbot/IRC.hs index c10467e..a489ee9 100644 --- a/Hsbot/IRC.hs +++ b/Hsbot/IRC.hs @@ -5,11 +5,9 @@ module Hsbot.IRC import Control.Concurrent.Chan import Control.Monad.State -import qualified Data.Map as M import Hsbot.Command import Hsbot.IRCParser -import Hsbot.Plugin import Hsbot.Types import Hsbot.Utils @@ -27,17 +25,12 @@ initServer = do runServer :: IrcBot () runServer = do chan <- gets botChannel - plugins <- gets botPlugins let input = readChan chan msg <- liftIO input case msg of - InputMsg inputMsg -> do - dispatchCommand $ InputMsg inputMsg - mapM_ (sendToPlugin (InputMsg inputMsg) . snd) (M.toList plugins) - OutputMsg outputMsg -> - sendstr (serializeIrcMsg outputMsg) - InternalCmd _ -> - traceM "TODO internal command" + InputMsg inputMsg -> dispatchMessage $ InputMsg inputMsg + OutputMsg outputMsg -> sendstr (serializeIrcMsg outputMsg) + InternalCmd internalCmd -> processInternalCommand $ InternalCmd internalCmd runServer -- | Joins a chan -- cgit v1.2.3