]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showfavorites.php
Repeated and Favorited CSS/mf2 fixes
[quix0rs-gnu-social.git] / actions / showfavorites.php
index 65bb8f1bebae77207013e65b9741360a96aabbfd..0e028416da2cfa1314237403bf0b44bdcb576b4d 100644 (file)
@@ -99,12 +99,11 @@ class ShowfavoritesAction extends Action
 
         $nickname = common_canonical_nickname($this->arg('nickname'));
 
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
             // TRANS: Client error displayed when trying to display favourite notices for a non-existing user.
             $this->clientError(_('No such user.'));
-            return false;
         }
 
         $this->page = $this->trimmed('page');
@@ -132,7 +131,6 @@ class ShowfavoritesAction extends Action
         if (empty($this->notice)) {
             // TRANS: Server error displayed when favourite notices could not be retrieved from the database.
             $this->serverError(_('Could not retrieve favorite notices.'));
-            return;
         }
 
         if($this->page > 1 && $this->notice->N == 0){
@@ -165,7 +163,15 @@ class ShowfavoritesAction extends Action
      */
     function getFeeds()
     {
-        return array(new Feed(Feed::RSS1,
+        return array(new Feed(Feed::JSON,
+                              common_local_url('ApiTimelineFavorites',
+                                               array(
+                                                    'id' => $this->user->nickname,
+                                                    'format' => 'as')),
+                              // TRANS: Feed link text. %s is a username.
+                              sprintf(_('Feed for favorites of %s (Activity Streams JSON)'),
+                                      $this->user->nickname)),
+                     new Feed(Feed::RSS1,
                               common_local_url('favoritesrss',
                                                array('nickname' => $this->user->nickname)),
                               // TRANS: Feed link text. %s is a username.