Fixed the plugin loading process.
This commit is contained in:
parent
d0b0fb6ac1
commit
a6ba40c252
1 changed files with 19 additions and 18 deletions
|
@ -40,12 +40,13 @@ loadIrcPlugin :: String -> IrcBot ()
|
||||||
loadIrcPlugin pluginName = do
|
loadIrcPlugin pluginName = do
|
||||||
ircbot <- get
|
ircbot <- get
|
||||||
let masterChan = ircBotChan ircbot
|
let masterChan = ircBotChan ircbot
|
||||||
|
(entryPoint, loadIt) = case pluginName of
|
||||||
|
"Core" -> (ircBotPluginCore, True)
|
||||||
|
"Ping" -> (ircBotPluginPing, True)
|
||||||
|
"Quote" -> (ircBotPluginQuote, True)
|
||||||
|
_ -> (ircBotPluginDummy, False)
|
||||||
|
when loadIt $ do
|
||||||
pluginChan <- liftIO (newChan :: IO (Chan IrcBotMsg))
|
pluginChan <- liftIO (newChan :: IO (Chan IrcBotMsg))
|
||||||
let entryPoint = case pluginName of
|
|
||||||
"Core" -> ircBotPluginCore
|
|
||||||
"Ping" -> ircBotPluginPing
|
|
||||||
"Quote" -> ircBotPluginQuote
|
|
||||||
_ -> ircBotPluginDummy
|
|
||||||
let oldPlugins = ircBotPlugins ircbot
|
let oldPlugins = ircBotPlugins ircbot
|
||||||
-- We check for unicity
|
-- We check for unicity
|
||||||
case M.lookup pluginName oldPlugins of
|
case M.lookup pluginName oldPlugins of
|
||||||
|
|
Reference in a new issue