]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/botuser.rb
plugin(points): forgot one special case, see #34
[user/henk/code/ruby/rbot.git] / lib / rbot / botuser.rb
index f7e41d972f55b1f9b6583664e0b727c49143128c..97bab93cc34545c3ed4c875209107eec3dd2624c 100644 (file)
@@ -35,7 +35,8 @@ class Bot
   module Auth
 
     Config.register Config::StringValue.new( 'auth.password',
-      :default => 'rbotauth', :wizard => true,
+      :default => [*?a..?z,*?A..?Z,*?0..?9].sample(8).join, :store_default => true,
+      :wizard => true,
       :on_change => Proc.new {|bot, v| bot.auth.botowner.password = v},
       :desc => _('Password for the bot owner'))
     Config.register Config::BooleanValue.new( 'auth.login_by_mask',
@@ -90,8 +91,8 @@ class Bot
       #
       def initialize(cmd)
         cmdpath = sanitize_command_path(cmd).split('::')
-        seq = cmdpath.inject(["*"]) { |list, cmd|
-          list << (list.length > 1 ? list.last + "::" : "") + cmd
+        seq = cmdpath.inject(["*"]) { |list, cc|
+          list << (list.length > 1 ? list.last + "::" : "") + cc
         }
         @path = seq.map { |k|
           k.to_sym
@@ -872,7 +873,7 @@ class Bot
         if user.class <= BotUser
           botuser = user
         else
-          botuser = irc_to_botuser(user)
+          botuser = user.botuser
         end
         cmd = cmdtxt.to_irc_auth_command