Committer: dnikolaev
LJSUP-8911: Users should view other friends pages with owner settingsU trunk/cgi-bin/LJ/S2/FriendsPage.pm U trunk/cgi-bin/ljlib.pl U trunk/cgi-bin/ljviews.pl
Modified: trunk/cgi-bin/LJ/S2/FriendsPage.pm =================================================================== --- trunk/cgi-bin/LJ/S2/FriendsPage.pm 2011-05-27 08:00:49 UTC (rev 19156) +++ trunk/cgi-bin/LJ/S2/FriendsPage.pm 2011-05-27 08:41:09 UTC (rev 19157) @@ -147,11 +147,6 @@ # use Time::HiRes qw//; # my $t0 = [Time::HiRes::gettimeofday]; - my $friends_tags = undef; - if ($remote && !$get->{notags}) { - $friends_tags = LJ::FriendsTags->load($remote); - } - ## load the itemids my %friends; my %friends_row; @@ -171,7 +166,7 @@ 'friendsoffriends' => $opts->{'view'} eq "friendsfriends", 'dateformat' => 'S2', 'events_date' => $events_date, - 'filter_by_tags' => $friends_tags, + 'filter_by_tags' => ($get->{notags} ? 0 : 1), }); # warn "[FriendsPage=$user] Items loaded. elapsed=" . Time::HiRes::tv_interval( $t0, [Time::HiRes::gettimeofday]) . " sec"; Modified: trunk/cgi-bin/ljlib.pl =================================================================== --- trunk/cgi-bin/ljlib.pl 2011-05-27 08:00:49 UTC (rev 19156) +++ trunk/cgi-bin/ljlib.pl 2011-05-27 08:41:09 UTC (rev 19157) @@ -883,6 +883,13 @@ } if $opts->{'friendsoffriends'} && ! @LJ::MEMCACHE_SERVERS; + my $friends_tags = undef; + if ($opts->{'filter_by_tags'} && !$opts->{'friendsoffriends'}) { + if ($opts->{u}) { + $friends_tags = LJ::FriendsTags->load($opts->{u}); + } + } + my $loop = 1; my $itemsleft = $getitems; # even though we got a bunch, potentially, they could be old my $fr; @@ -917,11 +924,8 @@ if (@newitems) { - if ($opts->{'filter_by_tags'}) { - die "Invalid type of parameter filter_by_tags: " . ref($opts->{filter_by_tags}) . "\n" - unless UNIVERSAL::isa($opts->{filter_by_tags}, 'LJ::FriendsTags'); - - my $filter_func = $opts->{'filter_by_tags'}->filter_func($friendid); + if ($friends_tags) { + my $filter_func = $friends_tags->filter_func($friendid); if ($filter_func) { my $idsbycluster = {}; foreach (@newitems) { Modified: trunk/cgi-bin/ljviews.pl =================================================================== --- trunk/cgi-bin/ljviews.pl 2011-05-27 08:00:49 UTC (rev 19156) +++ trunk/cgi-bin/ljviews.pl 2011-05-27 08:41:09 UTC (rev 19157) @@ -1711,11 +1711,6 @@ } } - my $friends_tags = undef; - if ($remote && !$get->{notags}) { - $friends_tags = LJ::FriendsTags->load($remote); - } - ## load the itemids my %friends; my %friends_row; @@ -1734,7 +1729,7 @@ 'showtypes' => $get->{'show'}, 'friendsoffriends' => $opts->{'view'} eq "friendsfriends", 'events_date' => $events_date, - 'filter_by_tags' => $friends_tags, + 'filter_by_tags' => ($get->{notags} ? 0 : 1), }); while ($_ = each %friends) {