Skip to content

Commit

Permalink
Merge pull request nandub#86 from pgolm/feature/fix-unflood
Browse files Browse the repository at this point in the history
fix new unflood options
  • Loading branch information
jgable committed Jul 12, 2013
2 parents 4d10cfa + 443f258 commit a7ac686
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,16 @@ class IrcBot extends Adapter
throw new Error("HUBOT_IRC_SERVER is not defined: try: export HUBOT_IRC_SERVER='irc.myserver.com'")

unfloodProtection: (unflood) ->
if unflood? then unflood else unflood == null
unflood == 'true' or !isNaN(parseInt(unflood))

unfloodProtectionDelay: (unflood) ->
switch @unfloodProtection(unflood)
when true then 1000
when false then 0
else parseInt(unflood / 60)
unfloodProtection = @unfloodProtection(unflood)
unfloodValue = parseInt(unflood) or 1000

if unfloodProtection
unfloodValue
else
0

run: ->
self = @
Expand Down

0 comments on commit a7ac686

Please sign in to comment.