]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
clearer scope rules for anonymous and author
authorEvan Prodromou <evan@status.net>
Sat, 26 Mar 2011 20:23:20 +0000 (16:23 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 26 Mar 2011 20:23:20 +0000 (16:23 -0400)
classes/Notice.php

index b380f027a2a0266eb96be66b1b747e9ecfe98a62..f6d0a689cb8c0add472349ebd3cc42142ea2a5f3 100644 (file)
@@ -2043,10 +2043,21 @@ class Notice extends Memcached_DataObject
 
     function inScope($profile)
     {
-        // If there's any scope, and there's no logged-in user,
-        // not allowed.
+        // If there's no scope, anyone (even anon) is in scope.
 
-        if ($this->scope > 0 && empty($profile)) {
+        if ($this->scope == 0) {
+            return true;
+        }
+
+        // If there's scope, anon cannot be in scope
+
+        if (empty($profile)) {
+            return false;
+        }
+
+        // Author is always in scope
+
+        if ($this->profile_id == $profile->id) {
             return false;
         }