]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
cache the scope for null profile
authorEvan Prodromou <evan@status.net>
Sun, 10 Apr 2011 23:19:10 +0000 (19:19 -0400)
committerEvan Prodromou <evan@status.net>
Sun, 10 Apr 2011 23:19:10 +0000 (19:19 -0400)
classes/Notice.php

index 0f2006e14394b12b19c2e1de286461bfd4707ecb..de45bdaae180b017f90359031cdb3948a7035e82 100644 (file)
@@ -2305,7 +2305,11 @@ class Notice extends Memcached_DataObject
      */
     function inScope($profile)
     {
-        $keypart = sprintf('notice:in-scope-for:%d:%d', $this->id, $profile->id);
+        if (is_null($profile)) {
+            $keypart = sprintf('notice:in-scope-for:%d:null', $this->id);
+        } else {
+            $keypart = sprintf('notice:in-scope-for:%d:%d', $this->id, $profile->id);
+        }
 
         $result = self::cacheGet($keypart);