We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 20396ce8 authored by Evan Prodromou's avatar Evan Prodromou

ActivityStreamJSONDocument served as application/stream+json

parent fadc4df0
...@@ -170,7 +170,7 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction ...@@ -170,7 +170,7 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
$this->showJsonTimeline($this->notices); $this->showJsonTimeline($this->notices);
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($title); $doc->setTitle($title);
$doc->addLink($link,'alternate', 'text/html'); $doc->addLink($link,'alternate', 'text/html');
......
...@@ -266,7 +266,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction ...@@ -266,7 +266,7 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
$this->showJsonTimeline($this->notices); $this->showJsonTimeline($this->notices);
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($title); $doc->setTitle($title);
$doc->addLink($link,'alternate', 'text/html'); $doc->addLink($link,'alternate', 'text/html');
......
...@@ -135,7 +135,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction ...@@ -135,7 +135,7 @@ class ApiTimelineGroupAction extends ApiPrivateAuthAction
$this->showJsonTimeline($this->notices); $this->showJsonTimeline($this->notices);
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($atom->title); $doc->setTitle($atom->title);
$doc->addLink($link, 'alternate', 'text/html'); $doc->addLink($link, 'alternate', 'text/html');
......
...@@ -169,7 +169,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction ...@@ -169,7 +169,7 @@ class ApiTimelineHomeAction extends ApiBareAuthAction
$this->showJsonTimeline($this->notices); $this->showJsonTimeline($this->notices);
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($title); $doc->setTitle($title);
$doc->addLink($link, 'alternate', 'text/html'); $doc->addLink($link, 'alternate', 'text/html');
......
...@@ -170,7 +170,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction ...@@ -170,7 +170,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
$this->showJsonTimeline($this->notices); $this->showJsonTimeline($this->notices);
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($title); $doc->setTitle($title);
$doc->addLink($link, 'alternate', 'text/html'); $doc->addLink($link, 'alternate', 'text/html');
......
...@@ -235,7 +235,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction ...@@ -235,7 +235,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction
$this->showJsonTimeline($this->notices); $this->showJsonTimeline($this->notices);
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($title); $doc->setTitle($title);
$doc->addLink($link, 'alternate', 'text/html'); $doc->addLink($link, 'alternate', 'text/html');
......
...@@ -138,7 +138,7 @@ class ApiTimelineRetweetedToMeAction extends ApiAuthAction ...@@ -138,7 +138,7 @@ class ApiTimelineRetweetedToMeAction extends ApiAuthAction
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($title); $doc->setTitle($title);
$doc->addLink($link, 'alternate', 'text/html'); $doc->addLink($link, 'alternate', 'text/html');
......
...@@ -137,7 +137,7 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction ...@@ -137,7 +137,7 @@ class ApiTimelineRetweetsOfMeAction extends ApiAuthAction
$this->raw($atom->getString()); $this->raw($atom->getString());
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($title); $doc->setTitle($title);
$doc->addLink($link, 'alternate', 'text/html'); $doc->addLink($link, 'alternate', 'text/html');
......
...@@ -153,7 +153,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction ...@@ -153,7 +153,7 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
$this->showJsonTimeline($this->notices); $this->showJsonTimeline($this->notices);
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($title); $doc->setTitle($title);
$doc->addLink($link, 'alternate', 'text/html'); $doc->addLink($link, 'alternate', 'text/html');
......
...@@ -202,7 +202,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction ...@@ -202,7 +202,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
$this->showJsonTimeline($this->notices); $this->showJsonTimeline($this->notices);
break; break;
case 'as': case 'as':
header('Content-Type: application/json; charset=utf-8'); header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE);
$doc = new ActivityStreamJSONDocument($this->auth_user); $doc = new ActivityStreamJSONDocument($this->auth_user);
$doc->setTitle($atom->title); $doc->setTitle($atom->title);
$doc->addLink($link, 'alternate', 'text/html'); $doc->addLink($link, 'alternate', 'text/html');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment