diff options
author | Julien Dessaux | 2010-02-04 20:40:16 +0100 |
---|---|---|
committer | Julien Dessaux | 2010-02-04 20:40:16 +0100 |
commit | cf68de02be3e9695c95b0d1fafdab5ab2c0fc5f7 (patch) | |
tree | 977286771d0f9e126ae599af01a63e06b3c67d2d /Hsbot/IRC.hs | |
parent | Finished changing plugin data structure to Maps. (diff) | |
download | hsbot-cf68de02be3e9695c95b0d1fafdab5ab2c0fc5f7.tar.gz hsbot-cf68de02be3e9695c95b0d1fafdab5ab2c0fc5f7.tar.bz2 hsbot-cf68de02be3e9695c95b0d1fafdab5ab2c0fc5f7.zip |
Added command registering and dispatching for plugins.
Diffstat (limited to 'Hsbot/IRC.hs')
-rw-r--r-- | Hsbot/IRC.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Hsbot/IRC.hs b/Hsbot/IRC.hs index a8f3fcb..c10467e 100644 --- a/Hsbot/IRC.hs +++ b/Hsbot/IRC.hs @@ -7,6 +7,7 @@ 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 @@ -30,12 +31,13 @@ runServer = do let input = readChan chan msg <- liftIO input case msg of - InputMsg inputMsg -> + InputMsg inputMsg -> do + dispatchCommand $ InputMsg inputMsg mapM_ (sendToPlugin (InputMsg inputMsg) . snd) (M.toList plugins) OutputMsg outputMsg -> sendstr (serializeIrcMsg outputMsg) - InternalCmd internalCmd -> - traceM "TODO" + InternalCmd _ -> + traceM "TODO internal command" runServer -- | Joins a chan |