]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apitimelinefriends.php
added comments
[quix0rs-gnu-social.git] / actions / apitimelinefriends.php
index 9ef3ace607eb5b9ef22ad96bd495ca887c413b1c..9c6ffcf9c53536c03ab6626e9b013398e50c904b 100644 (file)
@@ -117,9 +117,17 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
 
         $subtitle = sprintf(
             _('Updates from %1$s and friends on %2$s!'),
-            $this->user->nickname, $sitename
+            $this->user->nickname,
+            $sitename
         );
 
+        $link = common_local_url(
+            'all',
+             array('nickname' => $this->user->nickname)
+        );
+
+        $self = $this->getSelfUri();
+
         $logo = (!empty($avatar))
             ? $avatar->displayUrl()
             : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
@@ -130,50 +138,29 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
             break;
         case 'rss':
 
-            $link = common_local_url(
-                'all', array(
-                    'nickname' => $this->user->nickname
-                )
-            );
-
             $this->showRssTimeline(
                 $this->notices,
                 $title,
                 $link,
                 $subtitle,
                 null,
-                $logo
+                $logo,
+                $self
             );
             break;
         case 'atom':
 
             header('Content-Type: application/atom+xml; charset=utf-8');
 
-            $atom = new AtomNoticeFeed();
+            $atom = new AtomNoticeFeed($this->auth_user);
 
             $atom->setId($id);
             $atom->setTitle($title);
             $atom->setSubtitle($subtitle);
             $atom->setLogo($logo);
             $atom->setUpdated('now');
-
-            $atom->addLink(
-                common_local_url(
-                    'all',
-                    array('nickname' => $this->user->nickname)
-                )
-            );
-
-            $id = $this->arg('id');
-            $aargs = array('format' => 'atom');
-            if (!empty($id)) {
-                $aargs['id'] = $id;
-            }
-
-            $atom->addLink(
-                $this->getSelfUri('ApiTimelineFriends', $aargs),
-                array('rel' => 'self', 'type' => 'application/atom+xml')
-            );
+            $atom->addLink($link);
+            $atom->setSelfLink($self);
 
             $atom->addEntryFromNotices($this->notices);