Archived
1
0
Fork 0

Cleaned further the bot updates handling.

This commit is contained in:
Julien Dessaux 2010-05-28 22:39:45 +02:00
parent 451564ef5b
commit c506c58e92
5 changed files with 53 additions and 49 deletions

View file

@ -145,11 +145,8 @@ reportUpdate :: IrcBot ()
reportUpdate = do
ircbot <- get
let masterChan = ircBotMasterChan ircbot
msg = IntMsg $ Msg { msgType = "UPDATE"
, msgFrom = ircConfigName $ ircBotConfig ircbot
, msgTo = "CORE"
, msgStuff = show $ ircBotResumeData ircbot
}
msg = UpdMsg $ ResMsg { resMsgFrom = ircConfigName $ ircBotConfig ircbot
, resMsgData = ircBotResumeData ircbot }
liftIO $ writeChan masterChan msg
-- | Process a reboot command

View file

@ -32,7 +32,7 @@ data IrcBotState = IrcBotState
, ircBotConfig :: IrcConfig -- The starting configuration
, ircBotReaderThreadId :: ThreadId -- the thread that process inputs from the socket
, ircBotMasterReaderThreadId :: ThreadId -- the thread that process inputs from the master bot
, ircBotResumeData :: M.Map String String -- the necessary data to resume the bot's operations on reboot
, ircBotResumeData :: ResumeData -- the necessary data to resume the bot's operations on reboot
}
-- | The IrcServer monad