From 9986f7aa71c6e803aaeb2b8978adaed330a03dee Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 6 Dec 2007 13:06:00 +0000 Subject: userdata: don't extend the botuser hash to support dotted indices when migrating users --- lib/rbot/core/userdata.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/rbot/core/userdata.rb b/lib/rbot/core/userdata.rb index 6d7b7489..72cada78 100644 --- a/lib/rbot/core/userdata.rb +++ b/lib/rbot/core/userdata.rb @@ -56,7 +56,8 @@ class UserDataModule < CoreBotModule @botuser = @registry.sub_registry('botuser') end - def get_data_hash(user) + def get_data_hash(user, opts={}) + plain = opts[:plain] iu = user.to_irc_user bu = iu.botuser @@ -71,10 +72,12 @@ class UserDataModule < CoreBotModule end ih.merge!(bh) - class << ih - alias :single_retrieve :[] - alias :single_assign :[]= - include DottedIndex + unless plain + class << ih + alias :single_retrieve :[] + alias :single_assign :[]= + include DottedIndex + end end return ih @@ -171,7 +174,7 @@ class UserDataModule < CoreBotModule when :pre_perm @permification ||= {} k = [opts[:irc_user], opts[:bot_user]] - @permification[k] = get_data_hash(opts[:irc_user]) + @permification[k] = get_data_hash(opts[:irc_user], :plain => true) when :post_perm @permification ||= {} k = [opts[:irc_user], opts[:bot_user]] -- cgit v1.2.3