]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/jsonsearchresultslist.php
plugins onAutoload now only overloads if necessary (extlibs etc.)
[quix0rs-gnu-social.git] / lib / jsonsearchresultslist.php
index 0d72ddf7ab48184e41c371407ae9efefe6c940ea..7ae2b9953c0e1d63c78948d2ae101dbf5ad7cac6 100644 (file)
@@ -101,6 +101,10 @@ 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;
             }
@@ -213,7 +217,7 @@ class ResultItem
         $replier_profile = null;
 
         if ($this->notice->reply_to) {
-            $reply = Notice::staticGet(intval($this->notice->reply_to));
+            $reply = Notice::getKV(intval($this->notice->reply_to));
             if ($reply) {
                 $replier_profile = $reply->getProfile();
             }
@@ -228,10 +232,15 @@ class ResultItem
         $this->id           = $this->notice->id;
         $this->from_user_id = $this->profile->id;
 
-        $user = User::staticGet('id', $this->profile->id);
-
-        $this->iso_language_code = $user->language;
+        $user = $this->profile->getUser();
 
+        if (empty($user)) {
+            // Gonna have to do till we can detect it
+            $this->iso_language_code = common_config('site', 'language');
+        } else {
+            $this->iso_language_code = $user->language;
+        }
+        
         $this->source = $this->getSourceLink($this->notice->source);
 
         $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE);
@@ -252,9 +261,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':
@@ -264,7 +273,7 @@ class ResultItem
         case 'api':
             break;
         default:
-            $ns = Notice_source::staticGet($source);
+            $ns = Notice_source::getKV($source);
             if ($ns) {
                 $source_name = '<a href="' . $ns->url . '">' . $ns->name . '</a>';
             }
@@ -273,5 +282,4 @@ class ResultItem
 
         return $source_name;
     }
-
 }