From 9a1cf6a11b12c06cd925dd6a789ec98fe750c8ad Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 14 Jul 2008 00:57:43 +0200 Subject: * use to_irc_netmask(:force => true) to unlink Netmasks from their Server to prevent errors when dumping users --- lib/rbot/botuser.rb | 2 +- lib/rbot/irc.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/rbot/botuser.rb b/lib/rbot/botuser.rb index a4bec708..8fa04fc5 100644 --- a/lib/rbot/botuser.rb +++ b/lib/rbot/botuser.rb @@ -461,7 +461,7 @@ class Bot # Adds a Netmask # def add_netmask(mask) - m = mask.to_irc_netmask + m = mask.to_irc_netmask(:server => nil,:force => true) @netmasks << m if self.autologin? Auth.manager.maskdb.add(self, m) diff --git a/lib/rbot/irc.rb b/lib/rbot/irc.rb index 72579b19..0be26a00 100644 --- a/lib/rbot/irc.rb +++ b/lib/rbot/irc.rb @@ -214,6 +214,7 @@ module Irc h = {} h[:server] = @server if defined?(@server) and @server h[:casemap] = @casemap if defined?(@casemap) and @casemap + h[:casemap] ||= @server.casemap if defined?(@server) and @server return h end @@ -682,7 +683,7 @@ module Irc # Subclasses of Netmask will return a new Netmask, using full_downcase # def to_irc_netmask(opts={}) - if self.class == Netmask + if self.class == Netmask and not opts[:force] return self if fits_with_server_and_casemap?(opts) end return self.full_downcase.to_irc_netmask(server_and_casemap.merge(opts)) -- cgit v1.2.3