Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r18183: LJSUP-7845 (author can not deleted comme...

Committer: ailyin
LJSUP-7845 (author can not deleted comments from his post in community)
U   trunk/cgi-bin/LJ/Comment.pm
Modified: trunk/cgi-bin/LJ/Comment.pm
===================================================================
--- trunk/cgi-bin/LJ/Comment.pm	2011-02-02 07:02:43 UTC (rev 18182)
+++ trunk/cgi-bin/LJ/Comment.pm	2011-02-02 07:42:05 UTC (rev 18183)
@@ -897,10 +897,14 @@
     return 0 unless LJ::isu($targetu);
 
     my $journalu = $self->journal;
-    my $posteru  = $self->poster;
-    my $poster   = $posteru ? $posteru->{user} : undef;
+    my $up       = $self->entry->poster; # "posting user"
+    my $userpost = $self->poster;        # "commenting user"
 
-    return LJ::Talk::can_delete($targetu, $journalu, $posteru, $poster);
+    if ( $userpost ) {
+        $userpost = $userpost->username;
+    }
+
+    return LJ::Talk::can_delete($targetu, $journalu, $up, $userpost);
 }
 
 sub remote_can_edit {

Tags: andy, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments