]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apisearchjson.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / actions / apisearchjson.php
index 424773f12bf6bb41e7aea20b4ca780f447e764d8..4b46109b982e1d1988e3531a0c0539d641aa8f43 100644 (file)
@@ -118,7 +118,16 @@ class ApiSearchJSONAction extends ApiPrivateAuthAction
         $search_engine->limit(($this->page - 1) * $this->rpp, $this->rpp + 1);
         if ($search_engine->query($this->query)) {
             $cnt = $notice->find();
-            $this->notices = $notice->fetchAll();
+            foreach ($notice->fetchAll() as $testNotice) {
+                // Must be true
+                assert($testNotice instanceof Notice);
+
+                // Check scope of notice to current profile (including guests)
+                if ($testNotice->isCurrentProfileInScope()) {
+                    // In scope
+                    $this->notices[] = $testNotice;
+                }
+            } // END - if
         }
 
        $this->showJsonTimeline($this->notices);