From: Mikael Nordfeldth Date: Sat, 10 Oct 2015 18:36:54 +0000 (+0200) Subject: Use an atom:link to ApiMediaUpload response instead of mediahref X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b4c51b2d39af518b297848307820df53d76fc999;p=quix0rs-gnu-social.git Use an atom:link to ApiMediaUpload response instead of mediahref 'cause why not? --- diff --git a/actions/apimediaupload.php b/actions/apimediaupload.php index fedaef1748..3a06a75e85 100644 --- a/actions/apimediaupload.php +++ b/actions/apimediaupload.php @@ -91,10 +91,14 @@ class ApiMediaUploadAction extends ApiAuthAction function showResponse(MediaFile $upload) { $this->initDocument(); - $this->elementStart('rsp', array('stat' => 'ok')); + $this->elementStart('rsp', array('stat' => 'ok', 'xmlns:atom'=>Activity::ATOM)); $this->element('mediaid', null, $upload->fileRecord->id); $this->element('mediaurl', null, $upload->shortUrl()); - $this->element('mediahref', null, $upload->fileRecord->getUrl()); + + $enclosure = $upload->fileRecord->getEnclosure(); + $this->element('atom:link', array('rel' => 'enclosure', + 'href' => $enclosure->url, + 'type' => $enclosure->mimetype)); $this->elementEnd('rsp'); $this->endDocument(); }