diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bexley.pm | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bexley.pm b/perllib/FixMyStreet/Cobrand/Bexley.pm index 215b9d2cb..2c05439be 100644 --- a/perllib/FixMyStreet/Cobrand/Bexley.pm +++ b/perllib/FixMyStreet/Cobrand/Bexley.pm @@ -221,4 +221,12 @@ sub _is_out_of_hours { return 0; } +sub update_anonymous_message { + my ($self, $update) = @_; + my $t = Utils::prettify_dt( $update->confirmed ); + + my $staff = $update->user->from_body || $update->get_extra_metadata('is_body_user') || $update->get_extra_metadata('is_superuser'); + return sprintf('Posted anonymously by a non-staff user at %s', $t) if !$staff; +} + 1; diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 76e8d3185..82476ba10 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -272,7 +272,8 @@ sub meta_line { my $anon = $self->anonymous || !$self->name; if ($anon && (!$staff || $contributed_as eq 'anonymous_user' || $contributed_as eq 'another_user')) { - $meta = sprintf( _( 'Posted anonymously at %s' ), Utils::prettify_dt( $self->confirmed ) ) + $meta = $cobrand->call_hook(update_anonymous_message => $self); + $meta ||= sprintf( _( 'Posted anonymously at %s' ), Utils::prettify_dt( $self->confirmed ) ) } elsif ($staff) { my $user_name = FixMyStreet::Template::html_filter($self->user->name); my $body; |