]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apitimelinefriends.php
Fix for "#foo !foo" in same notice failing during save, causing failout before distri...
[quix0rs-gnu-social.git] / actions / apitimelinefriends.php
index 2db76857e3c7615d43647f24ad27f7867a33fcd8..ac350ab1b7a25acf8c5ee77dba5cd6269089670c 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,19 +138,14 @@ 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':
@@ -156,24 +159,8 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
             $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);
 
@@ -202,11 +189,11 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
         if (!empty($this->auth_user) && $this->auth_user->id == $this->user->id) {
             $notice = $this->user->ownFriendsTimeline(($this->page-1) * $this->count,
                                                       $this->count, $this->since_id,
-                                                      $this->max_id, $this->since);
+                                                      $this->max_id);
         } else {
             $notice = $this->user->friendsTimeline(($this->page-1) * $this->count,
                                                    $this->count, $this->since_id,
-                                                   $this->max_id, $this->since);
+                                                   $this->max_id);
         }
 
         while ($notice->fetch()) {