#!/usr/bin/perl # # LJ::Event::JournalNewComment::Edited - Event that's fired when someone edits a comment # # Authors: # Aaron Isaac # # Copyright (c) 2011 by Dreamwidth Studios, LLC. # # This program is free software; you may redistribute it and/or modify it under # the same terms as Perl itself. For a copy of the license, please reference # 'perldoc perlartistic' or 'perldoc perlgpl'. package LJ::Event::JournalNewComment::Edited; use strict; use base 'LJ::Event::JournalNewComment'; use LJ::JSON; sub content { my ( $self, $target ) = @_; my $comment = $self->comment; return undef unless $self->_can_view_content( $comment, $target ); LJ::need_res('js/commentmanage.js'); my $buttons = $comment->manage_buttons; my $dtalkid = $comment->dtalkid; my $htmlid = LJ::Talk::comment_htmlid($dtalkid); my $reason = LJ::ehtml( $comment->edit_reason ); my $comment_body = "This comment was edited. " . "Please see the original notification for the updated text."; $comment_body .= " " . LJ::Lang::get_default_text( "esn.journal_new_comment.edit_reason", { reason => $reason } ) . "." if $reason; my $ret = qq {
$buttons
$comment_body
}; my $cmt_info = $comment->info; $cmt_info->{form_auth} = LJ::form_auth(1); my $cmt_info_js = to_json($cmt_info) || '{}'; my $posterusername = $self->comment->poster ? $self->comment->poster->{user} : ""; $ret .= qq { }; $ret .= $self->as_html_actions; return $ret; } 1;