diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-12-06 13:06:00 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-12-06 13:06:00 +0000 |
commit | 9986f7aa71c6e803aaeb2b8978adaed330a03dee (patch) | |
tree | 775c015f9f04b498ab4f2c3f5fdb55750246bd7f | |
parent | d3f563a8e2937416c379df030f9d2d1287eadf0e (diff) |
userdata: don't extend the botuser hash to support dotted indices when migrating users
-rw-r--r-- | lib/rbot/core/userdata.rb | 15 |
1 files 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]] |