Permalink
Browse files

Remove the redundent part of the plugin name in the plugin lookup.

  • Loading branch information...
1 parent 3ee507c commit 2c1278d9bb86f61369bb0d620061e71eeefc338a @wilkie wilkie committed Oct 14, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 lib/xombot.rb
  2. +1 −1 lib/xombot/plugins/url_announce.rb
View
@@ -38,7 +38,8 @@ class << self
def add_plugin plugin
@plugins = {} if @plugins.nil?
- @plugins[plugin.class.name] = plugin
+ plugin_name = plugin.class.name[/^XOmBot::Plugins::(.*)/, 1]
+ @plugins[plugin_name] = plugin
end
def start
@@ -2,7 +2,7 @@ class URLAnnounce < XOmBot::Plugin
listen_to :channel
def listen(m)
- ignore_plugin = XOmBot.plugins["XOmBot::Plugins::Ignore"]
+ ignore_plugin = XOmBot.plugins["Ignore"]
return if ignore_plugin and ignore_plugin.ignored.include? m.user.nick
m.message.scan /https?:\/\/[\S]+/ do |url|

0 comments on commit 2c1278d

Please sign in to comment.