rss2irc 0.4.1 → 0.4.2
raw patch · 2 files changed
+11/−6 lines, 2 files
Files
- rss2irc.cabal +7/−3
- rss2irc.hs +4/−3
rss2irc.cabal view
@@ -1,5 +1,5 @@ name: rss2irc-version: 0.4.1+version: 0.4.2 homepage: http://hackage.haskell.org/package/rss2irc license: BSD3 license-file: LICENSE@@ -45,11 +45,15 @@ . > rss2irc http://hackage.haskell.org/packages/archive/recent.rss mybot@irc.freenode.org/#haskell .- Release notes for 0.4.1, 2009-09-25:+ Release notes for 0.4.2, 2009-09-27: .+ * fix a bug where every --max-items-th announcement was skipped+ .+ Release notes for 0.4.1, 2009-09-26:+ . * fix release notes issues .- Release notes for 0.4, 2009-09-25:+ Release notes for 0.4, 2009-09-26: . * wait for server connection confirmation before JOIN command. Problem was observed on irc.quakenet.org since it refuses
rss2irc.hs view
@@ -518,15 +518,16 @@ let maxitems = optIntValue MaxItems defaultmaxitems opts requiredidle = optIntValue Idle defaultidle opts -- minutes pollinterval = optIntValue Interval defaultinterval opts -- minutes- idleinterval = max (requiredidle-idle) 1 -- minutes sendinterval = if Debug `elem` opts then 0 else 2 -- seconds iscontinuation = continuationprefix `isPrefixOf` ann act | batchindex >= maxitems && not iscontinuation = (do when (DebugIrc `elem` opts) $ getTimeStamp >>= \t -> printf "%s: sent %d messages in this batch, max is %d, sleeping for %dm\n" t batchindex maxitems pollinterval >> hFlush stdout+ unGetChan q ann threadDelay $ pollinterval * minutes ircWriterThread bv 0)- | idle < requiredidle = (do+ | requiredidle > 0 && (idle < requiredidle) = (do+ let idleinterval = requiredidle-idle when (DebugIrc `elem` opts) $ getTimeStamp >>= \t -> printf "%s: channel has been idle %dm, %dm required, sleeping for %dm\n" t idle requiredidle idleinterval >> hFlush stdout unGetChan q ann@@ -534,7 +535,7 @@ ircWriterThread bv batchindex) | otherwise = (do when (DebugIrc `elem` opts) $- getTimeStamp >>= \t -> printf "%s: sent %d messages in this batch and channel has been idle %dm, sending next\n" t batchindex idle >> hFlush stdout+ getTimeStamp >>= \t -> printf "%s: sent %d messages in this batch%s, sending next\n" t batchindex (if requiredidle == 0 then "" else printf " and channel has been idle %dm" idle) >> hFlush stdout let (msg,rest) = splitAnnouncement ann unless (null rest) $ unGetChan q rest ircPrivmsgH b msg