X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=data%2Frbot%2Fplugins%2Fseen.rb;h=0fc6f0760f4dfcc91e8ac622f3e5f0fac3764c5c;hb=682e7f1708b9534385467b3d707433cb256b6405;hp=72ea92177e363d0109ad32346d8068cc91f78789;hpb=4d3cb7e7cea381189e35308dcac3cdecb63635bd;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/seen.rb b/data/rbot/plugins/seen.rb index 72ea9217..0fc6f076 100644 --- a/data/rbot/plugins/seen.rb +++ b/data/rbot/plugins/seen.rb @@ -81,20 +81,22 @@ class SeenPlugin < Plugin reg.last end - before = reg.first + if reg.kind_of? Array + before = reg.first + end formats = { :normal => _("%{nick} was last seen %{when}, %{doing}"), :with_before => _("%{nick} was last seen %{when}, %{doing} and %{time} before %{did_before}") } - if [:PART, :QUIT].include?(saw.type.to_sym) && + if before && [:PART, :QUIT].include?(saw.type.to_sym) && [:PUBLIC, :ACTION].include?(before.type.to_sym) did_before = case before.type.to_sym when :PUBLIC _("saying \"%{message}\"") when :ACTION - _("doing *%{message}*") + _("doing *%{nick} %{message}*") end % { :nick => saw.nick, :message => before.message @@ -127,7 +129,7 @@ class SeenPlugin < Plugin when :PUBLIC _("saying \"%{message}\"") when :ACTION - _("doing %{nick} %{message}") + _("doing *%{message}*") when :NICK _("changing nick from %{nick} to %{message}") when :PART