X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fplugins.rb;h=4d51cfc5e845d380cef3b1e588755dfe33353ef5;hb=d617583171610f5d9fce1efcff0b5b568ca79086;hp=250efa017c9859addc4f3f3e934b53eb0065768e;hpb=84f35b380e57fc490d9fa7bbe1ef710cc67a9101;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb index 250efa01..4d51cfc5 100644 --- a/lib/rbot/plugins.rb +++ b/lib/rbot/plugins.rb @@ -179,6 +179,7 @@ module Plugins def initialize @manager = Plugins::manager @bot = @manager.bot + @priority = nil @botmodule_triggers = Array.new @@ -533,11 +534,13 @@ module Plugins # the idea here is to prevent namespace pollution. perhaps there # is another way? plugin_module = Module.new + # each plugin uses its own textdomain, we bind it automatically here + bindtextdomain_to(plugin_module, "rbot-#{File.basename(fname, '.rb')}") desc = desc.to_s + " " if desc begin - plugin_string = IO.readlines(fname).join("") + plugin_string = IO.read(fname) debug "loading #{desc}#{fname}" plugin_module.module_eval(plugin_string, fname) return :loaded @@ -940,7 +943,7 @@ module Plugins if method.to_sym == :privmsg delegate('ctcp_listen', m) if m.ctcp delegate('message', m) - privmsg(m) if m.address? + privmsg(m) if m.address? and not m.ignored? delegate('unreplied', m) unless m.replied else delegate(method, m)