afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-07-01 03:47 pm

[dw-free] Navigation breaks in members only communities

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

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

Fix next/previous entry logic when encountering members-locked entries in
communities.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/LJ/Entry.pm
--------------------------------------------------------------------------------
diff -r 4758580ad6f5 -r 5564d0c21ca2 cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm	Wed Jul 01 23:38:24 2009 +0800
+++ b/cgi-bin/LJ/Entry.pm	Wed Jul 01 15:47:21 2009 +0000
@@ -1773,8 +1773,8 @@ sub get_itemid_near2
     if ($remote) {
         if ($remote->{'userid'} == $u->{'userid'}) {
             $secwhere = "";   # see everything
-        } elsif ($remote->{'journaltype'} eq 'P' || $remote->{'journaltype'} eq 'I') {
-            my $gmask = $u->trustmask( $remote );
+        } elsif ( $remote->is_individual ) {
+            my $gmask = $u->is_community ? $remote->member_of( $u ) : $u->trustmask( $remote );
             $secwhere = "AND (security='public' OR (security='usemask' AND allowmask & $gmask))"
                 if $gmask;
         }
--------------------------------------------------------------------------------