]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/jsonsearchresultslist.php
mail paths for docfile
[quix0rs-gnu-social.git] / lib / jsonsearchresultslist.php
index 7ff32f829f76b50dea9a54ae9f993b11a8269f71..8bf3678d4fa12fc5fad55d875b55c8985b3e2fe4 100644 (file)
  *
  * @category  Search
  * @package   StatusNet
- * @author    Zach Copley <zach@controlyourself.ca>
+ * @author    Zach Copley <zach@status.net>
  * @copyright 2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -36,7 +36,7 @@ if (!defined('LACONICA')) {
  *
  * @category Search
  * @package  StatusNet
- * @author   Zach Copley <zach@controlyourself.ca>
+ * @author   Zach Copley <zach@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  *
@@ -101,12 +101,22 @@ class JSONSearchResultsList
                 $this->max_id = (int)$this->notice->id;
             }
 
+            if ($this->since_id && $this->notice->id <= $this->since_id) {
+                break;
+            }
+
             if ($cnt > $this->rpp) {
                 break;
             }
 
-            $item = new ResultItem($this->notice);
-            array_push($this->results, $item);
+            $profile = $this->notice->getProfile();
+
+            // Don't show notices from deleted users
+
+            if (!empty($profile)) {
+                $item = new ResultItem($this->notice);
+                array_push($this->results, $item);
+            }
         }
 
         $time_end           = microtime(true);
@@ -148,7 +158,7 @@ class JSONSearchResultsList
  *
  * @category UI
  * @package  StatusNet
- * @author   Zach Copley <zach@controlyourself.ca>
+ * @author   Zach Copley <zach@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  * @see      JSONSearchResultsList
@@ -246,9 +256,9 @@ class ResultItem
      *
      * @return string a fully rendered source of the Notice
      */
-
     function getSourceLink($source)
     {
+        // Gettext translations for the below source types are available.
         $source_name = _($source);
         switch ($source) {
         case 'web':
@@ -267,5 +277,4 @@ class ResultItem
 
         return $source_name;
     }
-
 }