diff options
author | Evan Prodromou <evan@status.net> | 2010-11-15 11:57:19 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-11-15 11:57:19 -0500 |
commit | c1cee3b27ffa1529009195604c5495bef4f83bc2 (patch) | |
tree | 42ae51f86b085978c9f1a28820ec4a69af1589b9 /lib | |
parent | fdf3a23da7769586a818ca2219ec6bc1b46587de (diff) | |
parent | cb371d65c18771f8fcdcbeb450c063b844c000df (diff) |
Merge branch 'atompub' into 0.9.x
Conflicts:
actions/apistatusesshow.php
actions/apitimelineuser.php
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action.php | 11 | ||||
-rw-r--r-- | lib/apiaction.php | 6 | ||||
-rw-r--r-- | lib/router.php | 11 |
3 files changed, 26 insertions, 2 deletions
diff --git a/lib/action.php b/lib/action.php index 427b85427..17d3e2311 100644 --- a/lib/action.php +++ b/lib/action.php @@ -1404,4 +1404,15 @@ class Action extends HTMLOutputter // lawsuit $this->clientError(_('There was a problem with your session token.')); } } + + /** + * Check if the current request is a POST + * + * @return boolean true if POST; otherwise false. + */ + + function isPost() + { + return ($_SERVER['REQUEST_METHOD'] == 'POST'); + } } diff --git a/lib/apiaction.php b/lib/apiaction.php index 4e9dbb310..8a7be3150 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -726,6 +726,12 @@ class ApiAction extends Action $this->endDocument('xml'); } + function showSingleAtomStatus($notice) + { + header('Content-Type: application/atom+xml; charset=utf-8'); + print $notice->asAtomEntry(true, true, true, $this->auth_user); + } + function show_single_json_status($notice) { $this->initDocument('json'); diff --git a/lib/router.php b/lib/router.php index 9aaac7dfe..c0f3bf31d 100644 --- a/lib/router.php +++ b/lib/router.php @@ -399,12 +399,12 @@ class Router $m->connect('api/statuses/show.:format', array('action' => 'ApiStatusesShow', - 'format' => '(xml|json)')); + 'format' => '(xml|json|atom)')); $m->connect('api/statuses/show/:id.:format', array('action' => 'ApiStatusesShow', 'id' => '[0-9]+', - 'format' => '(xml|json)')); + 'format' => '(xml|json|atom)')); $m->connect('api/statuses/update.:format', array('action' => 'ApiStatusesUpdate', @@ -686,6 +686,13 @@ class Router $m->connect('api/oauth/authorize', array('action' => 'ApiOauthAuthorize')); + $m->connect('api/statusnet/app/service/:id.xml', + array('action' => 'ApiAtomService', + 'id' => '[a-zA-Z0-9]+')); + + $m->connect('api/statusnet/app/service.xml', + array('action' => 'ApiAtomService')); + // Admin $m->connect('admin/site', array('action' => 'siteadminpanel')); |