]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/ircsocket.rb
* more BDB leaking fixed
[user/henk/code/ruby/rbot.git] / lib / rbot / ircsocket.rb
index 36a223f9d52cc456efc1179835d143184e51f2ee..652b1f6dfc99883ded4027d6e0f7dc4bf5156dc1 100644 (file)
@@ -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 = pars.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