]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apitimelineretweetsofme.php
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
[quix0rs-gnu-social.git] / actions / apitimelineretweetsofme.php
index 6ca2c779cb9aade7514dd6991e69045a3d396047..26706a75e7650c1c65717bd79237676e635d36b5 100644 (file)
@@ -99,6 +99,8 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
 
         $strm = $this->auth_user->repeatsOfMe($offset, $limit, $this->since_id, $this->max_id);
 
+        common_debug(var_export($strm, true));
+
         switch ($this->format) {
         case 'xml':
             $this->showXmlTimeline($strm);
@@ -112,10 +114,38 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
             $title      = sprintf(_("Repeats of %s"), $this->auth_user->nickname);
             $taguribase = common_config('integration', 'taguri');
             $id         = "tag:$taguribase:RepeatsOfMe:" . $this->auth_user->id;
-            $link       = common_local_url('showstream',
-                                           array('nickname' => $this->auth_user->nickname));
 
-            $this->showAtomTimeline($strm, $title, $id, $link);
+            header('Content-Type: application/atom+xml; charset=utf-8');
+
+            $atom = new AtomNoticeFeed();
+
+            $atom->setId($id);
+            $atom->setTitle($title);
+            $atom->setSubtitle($subtitle);
+            $atom->setUpdated('now');
+
+            $atom->addLink(
+                common_local_url(
+                    'showstream',
+                    array('nickname' => $this->auth_user->nickname)
+                )
+            );
+
+            $id = $this->arg('id');
+            $aargs = array('format' => 'atom');
+            if (!empty($id)) {
+                $aargs['id'] = $id;
+            }
+
+            $atom->addLink(
+                $this->getSelfUri('ApiTimelineRetweetsOfMe', $aargs),
+                array('rel' => 'self', 'type' => 'application/atom+xml')
+            );
+
+            $atom->addEntryFromNotices($strm);
+
+            $this->raw($atom->getString());
+
             break;
 
         default:
@@ -123,4 +153,19 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
             break;
         }
     }
+
+    /**
+     * Return true if read only.
+     *
+     * MAY override
+     *
+     * @param array $args other arguments
+     *
+     * @return boolean is read only action?
+     */
+
+    function isReadOnly($args)
+    {
+        return true;
+    }
 }