LJSUP-17669: Login.bml form refactoring
[livejournal.git] / cgi-bin / LJ / Event / UserNewComment.pm
blob5c56e3d64916f59f5212d308754153739a135ac8
1 package LJ::Event::UserNewComment;
2 use strict;
3 use Scalar::Util qw(blessed);
4 use Class::Autouse qw(LJ::Comment);
5 use Carp qw(croak);
6 use base 'LJ::Event';
8 sub new {
9 my ($class, $comment) = @_;
10 croak 'Not an LJ::Comment' unless blessed $comment && $comment->isa("LJ::Comment");
11 return $class->SUPER::new($comment->poster,
12 $comment->journal->{userid}, $comment->jtalkid);
15 sub is_common { 0 }
17 # when was this comment left?
18 sub eventtime_unix {
19 my $self = shift;
20 my $cmt = $self->comment;
21 return $cmt ? $cmt->unixtime : $self->SUPER::eventtime_unix;
24 sub comment {
25 my $self = shift;
26 return LJ::Comment->new($self->journal, jtalkid => $self->arg1);
29 sub available_for_user { 0 }
30 sub is_tracking { 1 }
31 sub is_subscription_visible_to { 1 }