From 3410caa6f2e1fd74d55f7a1717420bb2e1052b12 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 29 May 2010 23:48:47 +0200 Subject: Fixed the plugin termination. The master of a plugin will now wait for the plugin it kills to terminate. --- Hsbot/Irc/Core.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Hsbot/Irc/Core.hs') diff --git a/Hsbot/Irc/Core.hs b/Hsbot/Irc/Core.hs index 229fef8..51032a8 100644 --- a/Hsbot/Irc/Core.hs +++ b/Hsbot/Irc/Core.hs @@ -110,7 +110,7 @@ ircBotLoop = forever $ do IntIrcCmd intIrcCmd -> do reboot <- processInternalCommand $ IntIrcCmd intIrcCmd reportUpdate - if reboot + if reboot == BotReboot then processRebootCommand else return () where @@ -131,9 +131,9 @@ dispatchMessage (InIrcMsg inIrcMsg) = do let key = tail . head $ words getMsgContent pluginNames = fromMaybe [] $ M.lookup key cmds plugins' = fromMaybe [] $ mapM (flip M.lookup plugins) pluginNames - in mapM_ (sendRunCommand (tail getMsgContent) . fst) plugins' + in mapM_ (sendRunCommand (tail getMsgContent) . first) plugins' else - mapM_ (sendToPlugin (InIrcMsg inIrcMsg) . fst) (M.elems plugins) + mapM_ (sendToPlugin (InIrcMsg inIrcMsg) . first) (M.elems plugins) where isPluginCommand :: IrcConfig -> Bool isPluginCommand config = -- cgit v1.2.3