summaryrefslogtreecommitdiff
path: root/lib/rbot/botuser.rb
diff options
context:
space:
mode:
authorDmitry Kim <dmitry point kim at gmail point com>2007-09-22 13:32:07 +0000
committerDmitry Kim <dmitry point kim at gmail point com>2007-09-22 13:32:07 +0000
commita5dcd5aee95ea6190107d4466c84af9e5cf22e1b (patch)
treea0d1e4eb08c67ef21c360f8cc7a0ed8a48dba3cb /lib/rbot/botuser.rb
parent0aa0919fdbfa148dfbb5961f14f27e41085959b4 (diff)
* (botuser) generalize() netmasks on transient->permanent
Diffstat (limited to 'lib/rbot/botuser.rb')
-rw-r--r--lib/rbot/botuser.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/rbot/botuser.rb b/lib/rbot/botuser.rb
index 1504a656..d61926b8 100644
--- a/lib/rbot/botuser.rb
+++ b/lib/rbot/botuser.rb
@@ -275,6 +275,10 @@ class Bot
@transient = false
reset_autologin
reset_password # or not?
+ @netmasks.dup.each do |m|
+ delete_netmask(m)
+ add_netmask(m.generalize)
+ end
end
# Create a new BotUser with given username
@@ -664,7 +668,6 @@ class Bot
[everyone, botowner].each do |x|
@allbotusers[x.username.to_sym] = x
end
- @transients = Set.new
end
def load_array(ary, forced)
@@ -778,7 +781,6 @@ class Bot
begin
bu = BotUser.new(ircuser, :transient => true, :masks => ircuser)
bu.login(ircuser)
- @transients << bu
rescue
warning "failed to create transient for #{user}"
error $!
@@ -792,7 +794,7 @@ class Bot
def logout_transients(m)
debug "to check: #{@botusers.keys.join ' '}"
@botusers.keys.each do |iu|
- debug "checking #{iu.fullform} agains #{m.fullform}"
+ debug "checking #{iu.fullform} against #{m.fullform}"
bu = @botusers[iu]
bu.transient? or next
iu.matches?(m) or next
@@ -820,7 +822,6 @@ class Bot
return nil unless tuser
raise TypeError, "#{tuser} is not transient" unless tuser.transient?
- @transients.delete(tuser)
tuser.make_permanent(name)
@allbotusers[tuser.username.to_sym] = tuser