From d7e6ca9a302bcce9e1ba530e49ef833e33890fa8 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 30 Sep 2011 22:58:59 +0200 Subject: Updated schema to save the channel on which the quote is from. --- Hsbot/Plugin/Quote.hs | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit v1.2.3