]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Improved handling of server limits
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 14 Mar 2007 00:14:34 +0000 (00:14 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 14 Mar 2007 00:14:34 +0000 (00:14 +0000)
lib/rbot/irc.rb

index c2c1e82fdd518c30889a1eed9cad0830857ea9de..08ad5e69dc832d22fedc347230ab27639c87f331 100644 (file)
@@ -1526,6 +1526,10 @@ module Irc
             groups.each { |g|\r
               k, v = g.split(':')\r
               @supports[key][k] = v.to_i || 0\r
+              if @supports[key][k] == 0\r
+                warn "Deleting #{key} limit of 0 for #{k}"\r
+                @supports[key].delete(k)\r
+              end\r
             }\r
           }\r
         when :chanmodes\r
@@ -1677,7 +1681,8 @@ module Irc
           channel_names.each { |n|\r
             count += 1 if k.include?(n[0])\r
           }\r
-          raise IndexError, "Already joined #{count} channels with prefix #{k}" if count == @supports[:chanlimit][k]\r
+          # raise IndexError, "Already joined #{count} channels with prefix #{k}" if count == @supports[:chanlimit][k]\r
+          warn "Already joined #{count}/#{@supports[:chanlimit][k]} channels with prefix #{k}, we may be going over server limits" if count >= @supports[:chanlimit][k]\r
         }\r
 \r
         # So far, everything is fine. Now create the actual Channel\r