From fb06b1f0bfc1b2185c91e0af5a97c3f462967996 Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Thu, 22 Nov 2007 13:26:50 +0100 Subject: [PATCH] Artemus story_body only touches the story if the user is not an editor. --- Gruta/Template/Artemus.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Gruta/Template/Artemus.pm b/Gruta/Template/Artemus.pm index a4e0014..d2d44b1 100644 --- a/Gruta/Template/Artemus.pm +++ b/Gruta/Template/Artemus.pm @@ -94,13 +94,23 @@ sub _artemus { }; $f{story_body} = sub { - my $story = $data->story($_[0], $_[1]); + my $topic_id = shift; + my $id = shift; + my $ret = '{-404}'; - if (not $data->auth()) { - $story->touch(); + if (my $topic = $data->topic($topic_id)) { + if (my $story = $data->story($topic_id, $id)) { + # touch the story if user is not + # (potentially) involved on it + if (! $topic->is_editor($data->auth())) { + $story->touch(); + } + + $ret = $data->special_uris($story->get('body')); + } } - return $data->special_uris($story->get('body')); + return $ret; }; $f{story_date} = sub { -- 2.11.4.GIT