vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r18639: LJSUP-8248: Add ability to unscreen comm...

Committer: vsukhanov
LJSUP-8248: Add ability to unscreen comment for sweepers.
U   trunk/cgi-bin/LJ/S2/EntryPage.pm
U   trunk/cgi-bin/LJ/Talk.pm
Modified: trunk/cgi-bin/LJ/S2/EntryPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/EntryPage.pm	2011-03-18 12:33:15 UTC (rev 18638)
+++ trunk/cgi-bin/LJ/S2/EntryPage.pm	2011-03-21 04:19:38 UTC (rev 18639)
@@ -500,9 +500,9 @@
         'maxcomments' => ($replycount >= LJ::get_cap($u, 'maxcomments')) ? 1 : 0,
         'enabled' => $entry->comments_shown,
         'locked' => !$entry->posting_comments_allowed,
-        'screened' => ($entry->prop("hasscreened") && $remote &&
-                       ($remote->{'user'} eq $u->{'user'} || $remote->can_manage($u))) ? 1 : 0,
+        'screened' => ($entry->prop("hasscreened") and $remote && LJ::Talk::can_view_screened($remote, $u)),
     });
+
     $comments->{show_postlink} = $entry->posting_comments_allowed;
     $comments->{show_readlink} = $entry->comments_shown && ($replycount || $comments->{'screened'});
 

Modified: trunk/cgi-bin/LJ/Talk.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk.pm	2011-03-18 12:33:15 UTC (rev 18638)
+++ trunk/cgi-bin/LJ/Talk.pm	2011-03-21 04:19:38 UTC (rev 18639)
@@ -370,6 +370,7 @@
     my ($remote, $u, $up, $userpost) = @_;
     return 0 unless $remote;
     return 0 if $remote->can_moderate($u);
+    return 1 if $remote->can_sweep($u);
     return LJ::Talk::can_delete($remote, $u, $up, $userpost);
 }
 
@@ -1273,7 +1274,7 @@
                     $post->{'state'} eq "S" && ! ($remote && ($remote->{'userid'} == $u->{'userid'} ||
                                                               $remote->{'userid'} == $uposterid ||
                                                               $remote->{'userid'} == $post->{'posterid'} ||
-                                                              $remote->can_manage($u) ));
+                                                              $remote->can_manage($u) ) || $remote->can_sweep($u));
             }
             if (LJ::is_enabled('spam_button') && !$opts->{showspam}) {
                 $should_show = 0 if $post->{'state'} eq 'B';

Tags: livejournal, pm, vadvs
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