Cleaned further the bot updates handling.
This commit is contained in:
parent
451564ef5b
commit
c506c58e92
5 changed files with 53 additions and 49 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in a new issue