summaryrefslogtreecommitdiff
path: root/Plugins
diff options
context:
space:
mode:
authorJulien Dessaux2010-04-21 20:57:22 +0200
committerJulien Dessaux2010-04-21 20:57:22 +0200
commit4c76d3d40bbfea365283c13256b3e7cf2d2deb5e (patch)
treeb5f4e70d225ba0247ad0691e37b45b8cb4142f6c /Plugins
parentFixed the clean killing of plugin's threads, fixed exception management and c... (diff)
downloadhsbot-4c76d3d40bbfea365283c13256b3e7cf2d2deb5e.tar.gz
hsbot-4c76d3d40bbfea365283c13256b3e7cf2d2deb5e.tar.bz2
hsbot-4c76d3d40bbfea365283c13256b3e7cf2d2deb5e.zip
Fixed several stuff.
Diffstat (limited to 'Plugins')
-rw-r--r--Plugins/Core.hs6
-rw-r--r--Plugins/Ping.hs2
2 files changed, 4 insertions, 4 deletions
diff --git a/Plugins/Core.hs b/Plugins/Core.hs
index b05e9aa..123d2e6 100644
--- a/Plugins/Core.hs
+++ b/Plugins/Core.hs
@@ -2,7 +2,7 @@ module Plugins.Core
( mainCore
) where
-import Control.Concurrent.Chan
+import Control.Concurrent.Chan(Chan)
import Control.Exception
import Control.Monad.State
import Prelude hiding (catch)
@@ -16,8 +16,8 @@ mainCore :: Chan BotMsg -> Chan BotMsg -> IO ()
mainCore serverChan chan = do
let plugin = PluginInstance "Core" serverChan chan
evalStateT (mapM_ sendRegisterCommand ["list", "load", "reload", "unload"]) plugin
- (execStateT run plugin) `catch` (\(ex :: AsyncException) -> return plugin)
- evalStateT (mapM_ sendUnregisterCommand ["list", "load", "reload", "unload"]) plugin
+ plugin' <- (execStateT run plugin) `catch` (\(_ :: AsyncException) -> return plugin)
+ evalStateT (mapM_ sendUnregisterCommand ["list", "load", "reload", "unload"]) plugin'
-- | The IrcPlugin monad main function
run :: IrcPlugin ()
diff --git a/Plugins/Ping.hs b/Plugins/Ping.hs
index 8258bcf..f478582 100644
--- a/Plugins/Ping.hs
+++ b/Plugins/Ping.hs
@@ -14,7 +14,7 @@ import Hsbot.Types
mainPing :: Chan BotMsg -> Chan BotMsg -> IO ()
mainPing serverChan chan = do
let plugin = PluginInstance "Ping" serverChan chan
- (execStateT run plugin) `catch` (\(ex :: AsyncException) -> return plugin)
+ _ <- (execStateT run plugin) `catch` (\(_ :: AsyncException) -> return plugin)
return ()
-- | The IrcPlugin monad main function