From d2f40f64819ec0b19911c684ea919beebf16af6d Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 4 Feb 2010 20:38:06 +0100 Subject: Finished changing plugin data structure to Maps. --- Hsbot/Core.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Hsbot/Core.hs') diff --git a/Hsbot/Core.hs b/Hsbot/Core.hs index b0efc03..621e670 100644 --- a/Hsbot/Core.hs +++ b/Hsbot/Core.hs @@ -7,6 +7,7 @@ import Control.Concurrent import Control.Concurrent.Chan import Control.Monad.State import Data.List +import qualified Data.Map as M import Network import System.IO import System.Time (getClockTime) @@ -28,13 +29,13 @@ connectServer server = do chan <- newChan :: IO (Chan BotMsg) threadId <- forkIO $ botReader handle chan putStrLn "done." - return (Bot server starttime handle [] [] chan threadId) + return (Bot server starttime handle [] M.empty chan threadId M.empty) -- | Disconnect from the server disconnectServer :: Bot -> IO () -- IO Bot ? disconnectServer bot = do killThread $ readerThreadId bot - mapM_ (killThread . pluginThreadId) (botPlugins bot) + mapM_ (killThread . pluginThreadId . snd) (M.toList $ botPlugins bot) hClose $ botHandle bot return () -- cgit v1.2.3