diff options
author | Julien Dessaux | 2010-05-29 23:48:47 +0200 |
---|---|---|
committer | Julien Dessaux | 2010-05-29 23:55:20 +0200 |
commit | 3410caa6f2e1fd74d55f7a1717420bb2e1052b12 (patch) | |
tree | 214cb220de340eada4141479ae6415e654a4fdc3 /Hsbot/Irc/Core.hs | |
parent | Added signal handling and a better semantic for bot status. (diff) | |
download | hsbot-3410caa6f2e1fd74d55f7a1717420bb2e1052b12.tar.gz hsbot-3410caa6f2e1fd74d55f7a1717420bb2e1052b12.tar.bz2 hsbot-3410caa6f2e1fd74d55f7a1717420bb2e1052b12.zip |
Fixed the plugin termination.
The master of a plugin will now wait for the plugin it kills to terminate.
Diffstat (limited to '')
-rw-r--r-- | Hsbot/Irc/Core.hs | 6 |
1 files changed, 3 insertions, 3 deletions
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 = |