]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/plugins.rb
Permissions can now be set and reset correctly
[user/henk/code/ruby/rbot.git] / lib / rbot / plugins.rb
index 42ff2aaa959382c6992b25b9bba7f8f3670d38a8..848240cffcb5cd7fb7ddda0268c487082cda126a 100644 (file)
@@ -417,9 +417,7 @@ module Plugins
 
     # call the cleanup method for each active plugin
     def cleanup
-      @bot.save_mutex.synchronize do
-        delegate 'cleanup'
-      end
+      delegate 'cleanup'
       reset_botmodule_lists
     end
 
@@ -507,24 +505,23 @@ module Plugins
         key = $1
         params = $2
         (core_modules + plugins).each { |p|
-          # debug "checking #{p.name.inspect} against #{key.inspect}"
+         next unless p.name == key
           begin
-            return p.help(params)
+            return p.help(key, params)
           rescue Exception => err
             #rescue TimeoutError, StandardError, NameError, SyntaxError => err
             error report_error("#{p.botmodule_class} #{p.name} help() failed:", err)
-          end if p.name == key
+          end
         }
+        k = key.to_sym
         [core_commands, plugin_commands].each { |pl|
-          # debug "looking for #{key.inspect} in #{pl.keys.sort.inspect}"
-          if pl.has_key?(key)
-            p = pl[key][:botmodule] 
-            begin
-              return p.help(key, params)
-            rescue Exception => err
-              #rescue TimeoutError, StandardError, NameError, SyntaxError => err
-              error report_error("#{p.botmodule_class} #{p.name} help() failed:", err)
-            end
+          next unless pl.has_key?(k)
+          p = pl[k][:botmodule] 
+          begin
+            return p.help(p.name, topic)
+          rescue Exception => err
+            #rescue TimeoutError, StandardError, NameError, SyntaxError => err
+            error report_error("#{p.botmodule_class} #{p.name} help() failed:", err)
           end
         }
       end