diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2009-06-17 22:15:59 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-03-07 20:34:58 +0100 |
commit | 8893bf66c0aa6f2bbf2e2941f7be82486fecdb46 (patch) | |
tree | afe064adcdf1a0c871752b37f881b0902005c805 /lib/rbot | |
parent | 5f9d3a09ef35ffe149aa080e6377d811a1994291 (diff) |
Implement penalty for WHO and PART based on eggdrop code.
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/ircsocket.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/rbot/ircsocket.rb b/lib/rbot/ircsocket.rb index 36a223f9..7c0253a5 100644 --- a/lib/rbot/ircsocket.rb +++ b/lib/rbot/ircsocket.rb @@ -48,8 +48,14 @@ class ::String dests = pars.split($;,2).first penalty += dests.split(',').size when :WHO - # I'm too lazy to implement this one correctly - penalty += 5 + args = parts.split + if args.length > 0 + penalty += args.inject(0){ |sum,x| sum += ((x.length > 4) ? 3 : 5) } + else + penalty += 10 + end + when :PART + penalty += 4 when :AWAY, :JOIN, :VERSION, :TIME, :TRACE, :WHOIS, :DNS penalty += 2 when :INVITE, :NICK |