Changeset 8893bf66c0aa6f2bbf2e2941f7be82486fecdb46

Show
Ignore:
Timestamp:
03/07/10 22:34:58 (5 months ago)
Author:
Giuseppe Bilotta <giuseppe.bilotta@…>
Children:
53c82a94714e439c63a65fccdaf2512383cffb7a
Parents:
5f9d3a09ef35ffe149aa080e6377d811a1994291
git-author:
Robin H. Johnson <robbat2@gentoo.org> 1245276959 +0000
git-committer:
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> 1267990498 +0100
Message:

Implement penalty for WHO and PART based on eggdrop code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lib/rbot/ircsocket.rb

    r1579c60 r8893bf6  
    4949      penalty += dests.split(',').size 
    5050    when :WHO 
    51       # I'm too lazy to implement this one correctly 
    52       penalty += 5 
     51      args = parts.split 
     52      if args.length > 0 
     53        penalty += args.inject(0){ |sum,x| sum += ((x.length > 4) ? 3 : 5) } 
     54      else 
     55        penalty += 10 
     56      end 
     57    when :PART 
     58      penalty += 4 
    5359    when :AWAY, :JOIN, :VERSION, :TIME, :TRACE, :WHOIS, :DNS 
    5460      penalty += 2