summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-05-24 13:49:38 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-05-24 13:52:15 +0200
commitc391125e75fe205056da8e7e0d31e988be37199a (patch)
tree9e6955db031d3fd4b36763a7b075c2140f751014 /data
parentedef2704ce1ea1f839ee03cc396cab8530de7046 (diff)
seen plugin: check if there's a previous action before using it
If the registry data is not an Array, there will be no 'before' information stored, so just use the normal output.
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/seen.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/data/rbot/plugins/seen.rb b/data/rbot/plugins/seen.rb
index babf7484..0fc6f076 100644
--- a/data/rbot/plugins/seen.rb
+++ b/data/rbot/plugins/seen.rb
@@ -81,14 +81,16 @@ 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