diff options
author | Julien Dessaux | 2011-09-30 22:58:59 +0200 |
---|---|---|
committer | Julien Dessaux | 2011-09-30 22:58:59 +0200 |
commit | d7e6ca9a302bcce9e1ba530e49ef833e33890fa8 (patch) | |
tree | 9d2f134809ce9d63488a1434a2348e5913065492 /Hsbot | |
parent | Forgot to add a notification on quote start command. (diff) | |
download | hsbot-d7e6ca9a302bcce9e1ba530e49ef833e33890fa8.tar.gz hsbot-d7e6ca9a302bcce9e1ba530e49ef833e33890fa8.tar.bz2 hsbot-d7e6ca9a302bcce9e1ba530e49ef833e33890fa8.zip |
Updated schema to save the channel on which the quote is from.
Diffstat (limited to 'Hsbot')
-rw-r--r-- | Hsbot/Plugin/Quote.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Hsbot/Plugin/Quote.hs b/Hsbot/Plugin/Quote.hs index 953ae52..30d5e7e 100644 --- a/Hsbot/Plugin/Quote.hs +++ b/Hsbot/Plugin/Quote.hs @@ -32,6 +32,7 @@ type QuoteID = Int -- | A quote object data Quote = Quote { quoter :: IRC.UserName + , quoteFrom :: IRC.Channel , quotE :: [QuoteElt] , quoteTime :: UTCTime , votes :: Int @@ -40,6 +41,7 @@ data Quote = Quote emptyQuote :: Quote emptyQuote = Quote { quoter = "" + , quoteFrom = "" , quotE = [] , quoteTime = posixSecondsToUTCTime 0 , votes = 0 @@ -259,6 +261,7 @@ quoteStart quoteDB msg quotee phrase = now <- liftIO getCurrentTime quoteID <- update' quoteDB (TakeNextQuoteID sender channel now) let newQuote = emptyQuote { quoter = sender + , quoteFrom = channel , quotE = [ QuoteElt { eltQuotee = quotee, eltQuote = thatQuote } ] , quoteTime = now } _ <- update' quoteDB (SetQuote quoteID newQuote) |