X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fseen.rb;h=a697d19b06722743884fe0411a84d177dc10a86e;hb=cec3f257a65f86a45d27e9ba8fcad347d0bd4e31;hp=a8dc1af7b8afc3bdc298f9b6a77f30111b373c34;hpb=d30940cb5ff75cf7eab81f6a588b3b5297a762ad;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/seen.rb b/data/rbot/plugins/seen.rb index a8dc1af7..a697d19b 100644 --- a/data/rbot/plugins/seen.rb +++ b/data/rbot/plugins/seen.rb @@ -21,6 +21,7 @@ class SeenPlugin < Plugin end def listen(m) + return if m.sourcenick.nil? # keep database up to date with who last said what if m.kind_of?(PrivMessage) return if m.private? @@ -66,20 +67,20 @@ class SeenPlugin < Plugin ret += Utils.secs_to_string(ago) + " ago, " end - case saw.type - when "PUBLIC" + case saw.type.to_sym + when :PUBLIC ret += "saying #{saw.message}" - when "ACTION" + when :ACTION ret += "doing #{saw.nick} #{saw.message}" - when "NICK" + when :NICK ret += "changing nick from #{saw.nick} to #{saw.message}" - when "PART" + when :PART ret += "leaving #{saw.where}" - when "JOIN" + when :JOIN ret += "joining #{saw.where}" - when "QUIT" - ret += "quiting IRC (#{saw.message})" - when "TOPIC" + when :QUIT + ret += "quitting IRC (#{saw.message})" + when :TOPIC ret += "changing the topic of #{saw.where} to #{saw.message}" end end