Committer: ailyin
LJSV-1222 (When a user deletes their account and chooses to delete their community entries, their entries remain visible on site scheme pages)U trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm U trunk/cgi-bin/LJ/S2/DayPage.pm U trunk/cgi-bin/LJ/S2/FriendsPage.pm U trunk/cgi-bin/LJ/S2/MonthPage.pm U trunk/cgi-bin/ljviews.pl U trunk/htdocs/talkread.bml U trunk/htdocs/view/index.bml
Modified: trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm =================================================================== --- trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm 2010-11-11 07:47:47 UTC (rev 17667) +++ trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm 2010-11-11 09:54:08 UTC (rev 17668) @@ -113,6 +113,7 @@ O => 'set_readonly', R => 'set_renamed', X => 'set_expunged', + D => 'set_deleted', }->{$new_status}; unless ($method) { Modified: trunk/cgi-bin/LJ/S2/DayPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/DayPage.pm 2010-11-11 07:47:47 UTC (rev 17667) +++ trunk/cgi-bin/LJ/S2/DayPage.pm 2010-11-11 09:54:08 UTC (rev 17668) @@ -131,10 +131,20 @@ } # don't show posts from suspended users or suspended posts - next ENTRY if $apu{$posterid} && $apu{$posterid}->{'statusvis'} eq 'S' && ! $viewsome; + my $pu = $apu{$posterid}; + next ENTRY if $pu && $pu->{'statusvis'} eq 'S' && ! $viewsome; next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); - if ($LJ::UNICODE && $logprops{$itemid}->{'unknown8bit'}) { + if ( !$viewsome && $pu && $pu->is_deleted + && !$LJ::JOURNALS_WITH_PROTECTED_CONTENT{$pu->username} ) + { + my ($purge_comments, $purge_community_entries) + = split /:/, $pu->prop("purge_external_content"); + + next ENTRY if $purge_community_entries; + } + + if ($LJ::UNICODE && $logprops{$itemid}->{'unknown8bit'}) { LJ::item_toutf8($u, \$subject, \$text, $logprops{$itemid}); } Modified: trunk/cgi-bin/LJ/S2/FriendsPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/FriendsPage.pm 2010-11-11 07:47:47 UTC (rev 17667) +++ trunk/cgi-bin/LJ/S2/FriendsPage.pm 2010-11-11 09:54:08 UTC (rev 17668) @@ -258,7 +258,22 @@ my $po = $posters{$posterid} || $friends{$posterid}; # don't allow posts from suspended users or suspended posts - if ($po->{'statusvis'} eq 'S' || ($entry_obj && $entry_obj->is_suspended_for($remote))) { + # or posts from users who chose to delete their entries when + # they deleted their journals + my $entry_hidden = 0; + $entry_hidden ||= $po->is_suspended; + $entry_hidden ||= $entry_obj && $entry_obj->is_suspended_for($remote); + + if ( $po->is_deleted + && !$LJ::JOURNALS_WITH_PROTECTED_CONTENT{$po->username} ) + { + my ($purge_comments, $purge_community_entries) + = split /:/, $po->prop("purge_external_content"); + + $entry_hidden ||= $purge_community_entries; + } + + if ($entry_hidden) { $hiddenentries++; # Remember how many we've skipped for later next ENTRY; } Modified: trunk/cgi-bin/LJ/S2/MonthPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/MonthPage.pm 2010-11-11 07:47:47 UTC (rev 17667) +++ trunk/cgi-bin/LJ/S2/MonthPage.pm 2010-11-11 09:54:08 UTC (rev 17668) @@ -111,10 +111,20 @@ $entry_obj->handle_prefetched_props($logprops{$itemid}); # don't show posts from suspended users or suspended posts - next unless $pu{$posterid}; - next ENTRY if $pu{$posterid}->{'statusvis'} eq 'S' && !$viewsome; + my $pu = $pu{$posterid}; + next unless $pu; + next ENTRY if $pu->is_suspended eq 'S' && !$viewsome; next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); + if ( !$viewsome && $pu && $pu->is_deleted + && !$LJ::JOURNALS_WITH_PROTECTED_CONTENT{$pu->username} ) + { + my ($purge_comments, $purge_community_entries) + = split /:/, $pu->prop("purge_external_content"); + next ENTRY if $purge_community_entries; + } + + if ($LJ::UNICODE && $logprops{$itemid}->{'unknown8bit'}) { my $text; LJ::item_toutf8($u, \$subject, \$text, $logprops{$itemid}); Modified: trunk/cgi-bin/ljviews.pl =================================================================== --- trunk/cgi-bin/ljviews.pl 2010-11-11 07:47:47 UTC (rev 17667) +++ trunk/cgi-bin/ljviews.pl 2010-11-11 09:54:08 UTC (rev 17668) @@ -1779,6 +1779,15 @@ next ENTRY if $pu && $pu->{'statusvis'} eq 'S'; next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); + if ( $pu->is_deleted + && !$LJ::JOURNALS_WITH_PROTECTED_CONTENT{$pu->username} ) + { + my ($purge_comments, $purge_community_entries) + = split /:/, $pu->prop("purge_external_content"); + + next ENTRY if $purge_community_entries; + } + # counting excludes skipped entries $eventnum++; @@ -2525,9 +2534,19 @@ my $entry_obj = LJ::Entry->new($u, ditemid => $ditemid); $entry_obj->handle_prefetched_props($logprops{$itemid}); - next ENTRY if $posteru{$posterid} && $posteru{$posterid}->{'statusvis'} eq 'S' && !$viewsome; + my $pu = $posteru{$posterid}; + next ENTRY if $pu && $pu->{'statusvis'} eq 'S' && !$viewsome; next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote); - + + if ( !$viewsome && $pu && $pu->is_deleted + && !$LJ::JOURNALS_WITH_PROTECTED_CONTENT{$pu->username} ) + { + my ($purge_comments, $purge_community_entries) + = split /:/, $pu->prop("purge_external_content"); + + next ENTRY if $purge_community_entries; + } + $eventnum++; my $replycount = $logprops{$itemid}->{'replycount'}; my $subject = $logtext->{$itemid}->[0]; Modified: trunk/htdocs/talkread.bml =================================================================== --- trunk/htdocs/talkread.bml 2010-11-11 07:47:47 UTC (rev 17667) +++ trunk/htdocs/talkread.bml 2010-11-11 09:54:08 UTC (rev 17668) @@ -152,6 +152,20 @@ return; } + if ( $up->is_deleted + && !$LJ::JOURNALS_WITH_PROTECTED_CONTENT{$up->username} ) + { + my ($purge_comments, $purge_community_entries) + = split /:/, $up->prop("purge_external_content"); + + if ($purge_community_entries) { + LJ::Request->pnotes ('error' => 'deleted'); + LJ::Request->pnotes ('remote' => LJ::get_remote()); + BML::return_error_status(404); + return; + } + } + # check suspended entry if ($entry && $entry->is_suspended_for($remote)) { LJ::Request->pnotes ('error' => 'suspended_post'); Modified: trunk/htdocs/view/index.bml =================================================================== --- trunk/htdocs/view/index.bml 2010-11-11 07:47:47 UTC (rev 17667) +++ trunk/htdocs/view/index.bml 2010-11-11 09:54:08 UTC (rev 17668) @@ -180,9 +180,19 @@ my ($itemid, $anum, $day, $eventtime, $posterid, $replycount, $security, $allowmask) = @$it; my $entry = LJ::Entry->new($u, jitemid => $itemid); - next if $u{$posterid}->is_suspended && !$viewsome; + my $pu = $u{$posterid}; + next if $pu->is_suspended && !$viewsome; next if $entry && $entry->is_suspended_for($remote); + if ( !$viewsome && $pu && $pu->is_deleted + && !$LJ::JOURNALS_WITH_PROTECTED_CONTENT{$pu->username} ) + { + my ($purge_comments, $purge_community_entries) + = split /:/, $pu->prop("purge_external_content"); + + next if $purge_community_entries; + } + my $subject = $lt->{$itemid}->[0]; my $poster = $u{$posterid}->{user};