From 36b162b56fcf47ea93e9fd7c8e206bd80fe6d1ed Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 3 Nov 2008 22:38:35 +0100 Subject: [PATCH] auth botmodule: auth_allow_deny() accepts an optional :auth_path parameter --- lib/rbot/core/auth.rb | 32 ++++++++++++++++++-------------- 1 file 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 -- 2.39.5