X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fircsocket.rb;h=4c11094b53f2151c9dd0118aa431a63e47da3112;hb=498a240496b65b897572e3fde3ef19b296e9c003;hp=36a223f9d52cc456efc1179835d143184e51f2ee;hpb=1579c60ee8ad2cb24eadbec66bfe3710775b2a05;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/ircsocket.rb b/lib/rbot/ircsocket.rb index 36a223f9..4c11094b 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 = 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 @@ -395,6 +401,7 @@ module Irc error "error while shutting down: #{e.pretty_inspect}" end @sock = nil + @server_uri = nil @sendq.clear end