diff options
Diffstat (limited to 'lib/Controller/MediaApiController.php')
-rw-r--r-- | lib/Controller/MediaApiController.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/Controller/MediaApiController.php b/lib/Controller/MediaApiController.php new file mode 100644 index 00000000..82cd0532 --- /dev/null +++ b/lib/Controller/MediaApiController.php @@ -0,0 +1,44 @@ +<?php + +declare(strict_types=1); + +// SPDX-FileCopyrightText: Carl Schwan <carl@carlschwan.eu> +// SPDX-License-Identifier: AGPL-3.0-or-later + +namespace OCA\Social\Controller; + +use OCP\AppFramework\Controller; +use OCP\Files\IMimeTypeDetector; + +class MediaApiController extends Controller { + public const IMAGE_MIME_TYPES = [ + 'image/png', + 'image/jpeg', + 'image/jpg', + 'image/gif', + 'image/x-xbitmap', + 'image/x-ms-bmp', + 'image/bmp', + 'image/svg+xml', + 'image/webp', + ]; + + private IMimeTypeDetector $mimeTypeDetector; + + /** + * Creates an attachment to be used with a new status. + * + * @NoAdminRequired + */ + public function uploadMedia(): DataResponse { + // TODO + return DataResponse([ + 'id' => 1, + 'url' => '', + 'preview_url' => '', + 'remote_url' => null, + 'text_url' => '', + 'description' => '', + ]); + } +} |