]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
rfc2812: Fix multiple RPL_WHOISCHANNELS handling
authorRobin H. Johnson <robbat2@gentoo.org>
Sun, 7 Mar 2010 03:22:04 +0000 (03:22 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 7 Mar 2010 09:46:18 +0000 (10:46 +0100)
The new Freenode ircd returns multiple RPL_WHOISCHANNELS lines (split
based on length), and they must be merged, otherwise only the last ends
up as the list of channels that the bot is in.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
lib/rbot/rfc2812.rb

index bbc91bdf67cb19efb5e653565d0822d21f3c22bd..fb70619c200f60b415da8439e5e4d09904b1c8c5 100644 (file)
@@ -1331,7 +1331,7 @@ module Irc
         when RPL_WHOISCHANNELS
           @whois ||= Hash.new
           @whois[:nick] = argv[1]
-          @whois[:channels] = []
+          @whois[:channels] ||= []
           user = @server.user(@whois[:nick])
           argv[-1].split.each do |prechan|
             pfx = prechan.scan(/[#{@server.supports[:prefix][:prefixes].join}]/)