summaryrefslogtreecommitdiffstats
path: root/lib/Controller/MediaApiController.php
blob: 717d35976fa5002c1ba45512adce2b163a21e145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?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\AppFramework\Http\DataResponse;
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 new DataResponse([
			'id' => 1,
			'url' => '',
			'preview_url' => '',
			'remote_url' => null,
			'text_url' => '',
			'description' => '',
		]);
	}
}