X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapitimelinementions.php;h=07fbdf0b674a3f6cb93a29c3638da21afa6c00e9;hb=88c00facc807d1c138146c02c703e2294b5d357b;hp=2857bd41ea3dc3e4933ed8170d4a3a6e3e7b28f0;hpb=0632d4f20c14a55b99d20fd394c340004d12c92b;p=quix0rs-gnu-social.git diff --git a/actions/apitimelinementions.php b/actions/apitimelinementions.php index 2857bd41ea..07fbdf0b67 100644 --- a/actions/apitimelinementions.php +++ b/actions/apitimelinementions.php @@ -170,7 +170,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction $this->showJsonTimeline($this->notices); break; case 'as': - header('Content-Type: application/json; charset=utf-8'); + header('Content-Type: ' . ActivityStreamJSONDocument::CONTENT_TYPE); $doc = new ActivityStreamJSONDocument($this->auth_user); $doc->setTitle($title); $doc->addLink($link, 'alternate', 'text/html'); @@ -178,7 +178,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction $this->raw($doc->asString()); break; default: - // TRANS: Client error displayed when trying to handle an unknown API method. + // TRANS: Client error displayed when coming across a non-supported API method. $this->clientError(_('API method not found.'), $code = 404); break; } @@ -193,10 +193,18 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction { $notices = array(); - $notice = $this->user->getReplies( - ($this->page - 1) * $this->count, $this->count, - $this->since_id, $this->max_id - ); + if (empty($this->auth_user)) { + $profile = null; + } else { + $profile = $this->auth_user->getProfile(); + } + + $stream = new ReplyNoticeStream($this->user->id, $profile); + + $notice = $stream->getNotices(($this->page - 1) * $this->count, + $this->count, + $this->since_id, + $this->max_id); while ($notice->fetch()) { $notices[] = clone($notice);