alf (red_alf) wrote in changelog,
alf
red_alf
changelog

[livejournal] r23037: LJSUP-13837: Edited entry in non-moderat...

Committer: afedorov
LJSUP-13837: Edited entry in non-moderated community go to moderation queue

U   trunk/cgi-bin/LJ/User.pm
U   trunk/cgi-bin/ljprotocol.pl
U   trunk/htdocs/community/settings.bml
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2012-10-03 09:09:18 UTC (rev 23036)
+++ trunk/cgi-bin/LJ/User.pm	2012-10-03 09:17:02 UTC (rev 23037)
@@ -6524,8 +6524,10 @@
 sub check_non_whitelist_enabled {
     my $u = shift;
     return 0 if $LJ::DISABLED{'spam_button'};
+    return 0 unless $u->is_community;
+    return 0 if $u->prop("moderated") eq 'N';
     my $check_non_whitelist = $u->prop('check_non_whitelist');
-    return 1 if (!defined($check_non_whitelist) || $check_non_whitelist eq 'Y');
+    return 1 if defined($check_non_whitelist) && $check_non_whitelist eq 'Y';
     return 0;
 }
 

Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2012-10-03 09:09:18 UTC (rev 23036)
+++ trunk/cgi-bin/ljprotocol.pl	2012-10-03 09:17:02 UTC (rev 23037)
@@ -3156,7 +3156,7 @@
     my $is_unsuspicious_user = 0;
     LJ::run_hook('is_unsuspicious_user_in_comm', $posterid, \$is_unsuspicious_user);
     my $is_approved_user = LJ::RelationService->is_relation_type_to( $ownerid, $posterid, [ 'A','M','N' ] );
-    unless ( $is_unsuspicious_user || $is_approved_user ) {
+    unless ( $is_unsuspicious_user || $is_approved_user || !$uowner->check_non_whitelist_enabled() ) {
 
         my $entry = LJ::Entry->new($ownerid, jitemid => $itemid);
         my $modid_old = $entry->prop("mod_queue_id");
@@ -3169,9 +3169,7 @@
         my $need_moderated = 0;
 
         my $suspicious_list = {};
-        if ( $uowner->check_non_whitelist_enabled() ) {
-            LJ::run_hook('spam_community_detector', $uowner, $req, \$need_moderated, $suspicious_list);
-        }
+        LJ::run_hook('spam_community_detector', $uowner, $req, \$need_moderated, $suspicious_list);
         
         foreach ( keys %$suspicious_list_old ) {
             delete $suspicious_list->{$_};

Modified: trunk/htdocs/community/settings.bml
===================================================================
--- trunk/htdocs/community/settings.bml	2012-10-03 09:09:18 UTC (rev 23036)
+++ trunk/htdocs/community/settings.bml	2012-10-03 09:17:02 UTC (rev 23037)
@@ -260,6 +260,8 @@
                     LJ::set_rel($cu->{'userid'}, $remote->{'userid'}, 'M');
                 }
                 $cu->set_prop('check_non_whitelist', $POST{check_non_whitelist} ? 'Y' : 'N');
+            } elsif ($moderated eq 'N') {
+                $cu->set_prop('check_non_whitelist', 'N');
             }
 
             # since journaltype changed

Tags: afedorov, bml, livejournal, pl, pm, red_alf
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