Config.register Config::IntegerValue.new('seen.max_results',
:default => 3, :validate => Proc.new{|v| v >= 0},
:desc => _("Maximum number of seen users to return in search (0 = no limit)."))
+ Config.register Config::ArrayValue.new('seen.ignore_patterns',
+ :default => [ "^no u$" ],
+ :desc => _("Strings/regexes that you'd like to ignore for 'last message' purposes"))
def help(plugin, topic="")
_("seen <nick> => have you seen, or when did you last see <nick>")
case m
when PrivMessage
return if m.private?
+ @bot.config['seen.ignore_patterns'].each { |regex|
+ return if m.message =~ /#{regex}/
+ }
+
type = m.action? ? 'ACTION' : 'PUBLIC'
store m, Saw.new(m.sourcenick.dup, now, type,
m.target.to_s, m.message.dup)
if before && [:PART, :QUIT].include?(saw.type.to_sym) &&
[:PUBLIC, :ACTION].include?(before.type.to_sym)
+ # TODO see chan_privacy
+ prev_chan_privacy = false
+ prev_where = prev_chan_privacy ? _(CHANPRIV_CHAN) : before.where
did_before = case before.type.to_sym
when :PUBLIC
_(msg_privacy ? MSGPRIV_MSG_PUBLIC : MSG_PUBLIC)
end % {
:nick => saw.nick,
:message => before.message,
- :where => where
+ :where => prev_where
}
format = :with_before