]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'atompub' into 0.9.x
authorEvan Prodromou <evan@status.net>
Mon, 15 Nov 2010 16:57:19 +0000 (11:57 -0500)
committerEvan Prodromou <evan@status.net>
Mon, 15 Nov 2010 16:57:19 +0000 (11:57 -0500)
Conflicts:
actions/apistatusesshow.php
actions/apitimelineuser.php

1  2 
EVENTS.txt
actions/apistatusesshow.php
actions/apitimelineuser.php
classes/Notice.php
lib/action.php

diff --cc EVENTS.txt
Simple merge
index a98e45f79ca04776b67a9e8de706dd8b27b04fe7,86ffd6862eb13b9bcc448c658e3f0fb1865bf1f9..f4a79ddbcb819c4cd2adeae710e267b43312c594
@@@ -100,9 -105,8 +100,9 @@@ class ApiStatusesShowAction extends Api
      {
          parent::handle($args);
  
-         if (!in_array($this->format, array('xml', 'json'))) {
+         if (!in_array($this->format, array('xml', 'json', 'atom'))) {
 +            // TRANS: Client error displayed when trying to handle an unknown API method.
-             $this->clientError(_('API method not found.'), $code = 404);
+             $this->clientError(_('API method not found.'), 404);
              return;
          }
  
      function showNotice()
      {
          if (!empty($this->notice)) {
-             if ($this->format == 'xml') {
+             switch ($this->format) {
+             case 'xml':
                  $this->showSingleXmlStatus($this->notice);
-             } elseif ($this->format == 'json') {
+                 break;
+             case 'json':
                  $this->show_single_json_status($this->notice);
+                 break;
+             case 'atom':
+                 $this->showSingleAtomStatus($this->notice);
+                 break;
+             default:
+                 throw new Exception(sprintf(_("Unsupported format: %s"), $this->format));
              }
          } else {
 -
              // XXX: Twitter just sets a 404 header and doens't bother
              // to return an err msg
  
index 0046c462d71cc7ef5970bdd01147378aa767eb26,7e76636460ad54b8761f37b4946eafcff7c65381..e4a8b596ee7d6491a817f7f2b826af420d719aa6
@@@ -132,16 -142,17 +137,16 @@@ class ApiTimelineUserAction extends Api
              break;
          case 'rss':
              $this->showRssTimeline(
-                 $this->notices,
-                 $atom->title,
-                 $link,
-                 $atom->subtitle,
-                 $suplink,
-                 $atom->logo,
-                 $self
-             );
+                                    $this->notices,
+                                    $atom->title,
+                                    $link,
+                                    $atom->subtitle,
+                                    $suplink,
+                                    $atom->logo,
+                                    $self
+                                    );
              break;
          case 'atom':
 -
              header('Content-Type: application/atom+xml; charset=utf-8');
  
              $atom->setId($self);
Simple merge
diff --cc lib/action.php
Simple merge