# TODO allow online editing of salutations\r
# TODO *REMEMBER* to set @changed to true after edit\r
# TODO or changes won't be saved\r
+#\r
+# TODO reply in the language the salutation was in\r
\r
unless Array.respond_to?(:pick_one)\r
debug "Defining the pick_one method for Array"\r
def listen(m)\r
return unless @match\r
return unless m.kind_of?(PrivMessage)\r
+ return if m.address? and m.plugin == 'config'\r
to_me = m.address? || m.message =~ /#{Regexp.escape(@bot.nick)}/i\r
if @bot.config['salut.address_only']\r
return unless to_me\r
salut = nil\r
[:both, :in, :out].each { |k|\r
next unless @match[k]\r
- debug "Checking salutations #{k} (#{@match[k].inspect})"\r
+ # debug "Checking salutations #{k} (#{@match[k].inspect})"\r
if m.message =~ @match[k]\r
salut = k\r
break\r
end\r
}\r
return unless salut\r
- # If the bot wasn't addressed, we continue only the match was exact\r
+ # If the bot wasn't addressed, we continue only if the match was exact\r
# (apart from space and punctuation) or if @match[:dest] matches too\r
return unless to_me or m.message =~ @match[:dest] or m.message =~ /^#{@punct}#{@match[salut]}#{@punct}$/\r
h = Time.new.hour\r