diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-11-03 22:38:35 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-11-03 22:38:35 +0100 |
commit | 36b162b56fcf47ea93e9fd7c8e206bd80fe6d1ed (patch) | |
tree | d0a9b4ee72a33924d14f32268c1e7fa9abc48d94 | |
parent | 297c80c7632e76e5c5a55cabad57154706911b57 (diff) |
auth botmodule: auth_allow_deny() accepts an optional :auth_path parameter
-rw-r--r-- | lib/rbot/core/auth.rb | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/lib/rbot/core/auth.rb b/lib/rbot/core/auth.rb index 75c59f27..9e9d3575 100644 --- a/lib/rbot/core/auth.rb +++ b/lib/rbot/core/auth.rb @@ -242,23 +242,27 @@ class AuthModule < CoreBotModule where = m.parse_channel_list(p[:where].to_s).first # should only be one anyway end - # pseudo-message to find the template. The source is ignored, and the - # target is set according to where the template should be checked - # (public or private) - # This might still fail in the case of 'everywhere' for commands there are - # really only private - case where - when :"?" - pseudo_target = @bot.myself - when :* - pseudo_target = m.channel + if p.has_key? :auth_path + auth_path = p[:auth_path] else - pseudo_target = m.server.channel(where) - end + # pseudo-message to find the template. The source is ignored, and the + # target is set according to where the template should be checked + # (public or private) + # This might still fail in the case of 'everywhere' for commands there are + # really only private + case where + when :"?" + pseudo_target = @bot.myself + when :* + pseudo_target = m.channel + else + pseudo_target = m.server.channel(where) + end - pseudo = PrivMessage.new(bot, m.server, m.source, pseudo_target, p[:stuff].to_s) + pseudo = PrivMessage.new(bot, m.server, m.source, pseudo_target, p[:stuff].to_s) - auth_path = find_auth(pseudo) + auth_path = find_auth(pseudo) + end debug auth_path if auth_path |