From: Robin H. Johnson Date: Sun, 7 Mar 2010 03:22:04 +0000 (+0000) Subject: rfc2812: Fix multiple RPL_WHOISCHANNELS handling X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=38c076622c020e509c8f1dca4e3168ea38f5999e;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git rfc2812: Fix multiple RPL_WHOISCHANNELS handling 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 --- diff --git a/lib/rbot/rfc2812.rb b/lib/rbot/rfc2812.rb index bbc91bdf..fb70619c 100644 --- a/lib/rbot/rfc2812.rb +++ b/lib/rbot/rfc2812.rb @@ -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}]/)