friendicaPhoto = $friendicaPhoto; } protected function rawContent(array $request = []) { $this->checkAllowedScope(BaseApi::SCOPE_READ); $uid = BaseApi::getCurrentUserID(); $type = $this->getRequestValue($this->parameters, 'extension', 'json'); if (empty($request['photo_id'])) { throw new HTTPException\BadRequestException('No photo id.'); } $scale = (!empty($request['scale']) ? intval($request['scale']) : null); $photo_id = $request['photo_id']; // prepare json/xml output with data from database for the requested photo $data = ['photo' => $this->friendicaPhoto->createFromId($photo_id, $scale, $uid, $type)]; $this->response->addFormattedContent('statuses', $data, $this->parameters['extension'] ?? null, Contact::getPublicIdByUserId($uid)); } }