summaryrefslogtreecommitdiff
path: root/Hsbot/Core.hs
diff options
context:
space:
mode:
authorJulien Dessaux2010-02-04 20:38:06 +0100
committerJulien Dessaux2010-02-04 20:38:06 +0100
commitd2f40f64819ec0b19911c684ea919beebf16af6d (patch)
tree18c7393fcd62d894741bdaede8f13e2bb708a437 /Hsbot/Core.hs
parentReorganized code and types, changed slightly the architecture. (diff)
downloadhsbot-d2f40f64819ec0b19911c684ea919beebf16af6d.tar.gz
hsbot-d2f40f64819ec0b19911c684ea919beebf16af6d.tar.bz2
hsbot-d2f40f64819ec0b19911c684ea919beebf16af6d.zip
Finished changing plugin data structure to Maps.
Diffstat (limited to 'Hsbot/Core.hs')
-rw-r--r--Hsbot/Core.hs5
1 files changed, 3 insertions, 2 deletions
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 ()