fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-08-26 02:06 am

[dw-free] http://bugs.dwscoalition.org/show_bug.cgi?id=3820

[commit: http://hg.dwscoalition.org/dw-free/rev/ad50bd960700]

http://bugs.dwscoalition.org/show_bug.cgi?id=3820

Fix handling of posts by suspended users in communities.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/S2/DayPage.pm
  • cgi-bin/LJ/S2/RecentPage.pm
--------------------------------------------------------------------------------
diff -r dee3a122cf42 -r ad50bd960700 cgi-bin/LJ/S2/DayPage.pm
--- a/cgi-bin/LJ/S2/DayPage.pm	Fri Aug 26 10:00:49 2011 +0800
+++ b/cgi-bin/LJ/S2/DayPage.pm	Fri Aug 26 10:04:06 2011 +0800
@@ -112,12 +112,6 @@
     my @items;
     push @items, $_ while $_ = $sth->fetchrow_hashref;
 
-    my %apu;  # alt poster users
-    foreach (@items) {
-        next unless $_->{posterid} != $u->{userid};
-        $apu{$_->{posterid}} = undef;
-    }
-
     $opts->{cut_disable} = ( $remote && $remote->prop( 'opt_cut_disable_journal' ) );
 
   ENTRY:
@@ -130,7 +124,7 @@
         my $entry_obj = LJ::Entry->new( $u, ditemid => $ditemid );
 
         # don't show posts from suspended users or suspended posts
-        next ENTRY if $apu{$posterid} && $apu{$posterid}->is_suspended && ! $viewsome;
+        next ENTRY if $entry_obj && $entry_obj->poster->is_suspended && ! $viewsome;
         next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote);
 
         # create S2 Entry object
diff -r dee3a122cf42 -r ad50bd960700 cgi-bin/LJ/S2/RecentPage.pm
--- a/cgi-bin/LJ/S2/RecentPage.pm	Fri Aug 26 10:00:49 2011 +0800
+++ b/cgi-bin/LJ/S2/RecentPage.pm	Fri Aug 26 10:04:06 2011 +0800
@@ -179,12 +179,6 @@
     my $itemnum = 0;
     my $lastentry = undef;
 
-    my (%apu);  # alt poster users
-    foreach (@items) {
-        next unless $_->{posterid} != $u->{userid};
-        $apu{$_->{posterid}} = undef;
-    }
-
     $opts->{cut_disable} = ( $remote && $remote->prop( 'opt_cut_disable_journal' ) );
 
   ENTRY:
@@ -202,7 +196,7 @@
         my $entry_obj = LJ::Entry->new( $u, ditemid => $ditemid );
 
         # don't show posts from suspended users or suspended posts unless the user doing the viewing says to (and is allowed)
-        next ENTRY if $apu{$posterid} && $apu{$posterid}->is_suspended && !$viewsome;
+        next ENTRY if $entry_obj && $entry_obj->poster->is_suspended && ! $viewsome;
         next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote);
 
         # create S2 entry, journal posted to is $u
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org