]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/rfc2812.rb
search: google calc can be in non-h2 headers
[user/henk/code/ruby/rbot.git] / lib / rbot / rfc2812.rb
index 0b7e07868d9e7c438c8b9178a395df2482183e23..fb70619c200f60b415da8439e5e4d09904b1c8c5 100644 (file)
@@ -967,6 +967,9 @@ module Irc
       # This is used by some messages to build lists of users that
       # will be delegated when the ENDOF... message is received
       @tmpusers = []
+
+      # Same as above, just for bans
+      @tmpbans = []
     end
 
     # Clear the server and reset the user
@@ -1180,6 +1183,17 @@ module Irc
           data[:users] = @tmpusers
           handle(:names, data)
           @tmpusers = Array.new
+        when RPL_BANLIST
+          data[:channel] = @server.channel(argv[1])
+          data[:mask] = argv[2]
+          data[:by] = argv[3]
+          data[:at] = argv[4]
+          @tmpbans << data
+        when RPL_ENDOFBANLIST
+          data[:channel] = @server.channel(argv[1])
+          data[:bans] = @tmpbans
+          handle(:banlist, data)
+          @tmpbans = Array.new
         when RPL_LUSERCLIENT
           # ":There are <integer> users and <integer>
           # services on <integer> servers"
@@ -1317,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}]/)