|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @author Viktar Dubiniuk <[email protected]> |
|
4
|
|
|
* |
|
5
|
|
|
* @copyright Copyright (c) 2018, ownCloud GmbH |
|
6
|
|
|
* @license AGPL-3.0 |
|
7
|
|
|
* |
|
8
|
|
|
* This code is free software: you can redistribute it and/or modify |
|
9
|
|
|
* it under the terms of the GNU Affero General Public License, version 3, |
|
10
|
|
|
* as published by the Free Software Foundation. |
|
11
|
|
|
* |
|
12
|
|
|
* This program is distributed in the hope that it will be useful, |
|
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15
|
|
|
* GNU Affero General Public License for more details. |
|
16
|
|
|
* |
|
17
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3, |
|
18
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|
19
|
|
|
* |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
namespace OCA\FederatedFileSharing\Ocm\Notification; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Class Notification |
|
26
|
|
|
* |
|
27
|
|
|
* @package OCA\FederatedFileSharing\Ocm |
|
28
|
|
|
*/ |
|
29
|
|
|
class FileNotification extends Notification { |
|
30
|
|
|
const NOTIFICATION_TYPE_SHARE_ACCEPTED = 'SHARE_ACCEPTED'; |
|
31
|
|
|
const NOTIFICATION_TYPE_SHARE_DECLINED = 'SHARE_DECLINED'; |
|
32
|
|
|
const NOTIFICATION_TYPE_SHARE_UNSHARED = 'SHARE_UNSHARED'; |
|
33
|
|
|
const NOTIFICATION_TYPE_REQUEST_RESHARE = 'REQUEST_RESHARE'; |
|
34
|
|
|
const NOTIFICATION_TYPE_RESHARE_UNDO = 'RESHARE_UNDO'; |
|
35
|
|
|
const NOTIFICATION_TYPE_RESHARE_CHANGE_PERMISSION = 'RESHARE_CHANGE_PERMISSION'; |
|
36
|
|
|
|
|
37
|
|
|
const RESOURCE_TYPE_FILE = 'file'; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @return string |
|
41
|
|
|
*/ |
|
42
|
|
|
public function getResourceType() { |
|
43
|
|
|
return self::RESOURCE_TYPE_FILE; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @return string |
|
48
|
|
|
*/ |
|
49
|
|
|
public function getNotificationType() { |
|
50
|
|
|
return $this->notificationType; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @param string $notificationType |
|
55
|
|
|
* |
|
56
|
|
|
* @return void |
|
57
|
|
|
*/ |
|
58
|
|
|
public function setNotificationType($notificationType) { |
|
59
|
|
|
$this->notificationType = $notificationType; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* Get all available notification types |
|
64
|
|
|
* |
|
65
|
|
|
* @return string[] |
|
66
|
|
|
*/ |
|
67
|
|
|
public function getNotificationTypes() { |
|
68
|
|
|
return [ |
|
69
|
|
|
self::NOTIFICATION_TYPE_SHARE_ACCEPTED, |
|
70
|
|
|
self::NOTIFICATION_TYPE_SHARE_DECLINED, |
|
71
|
|
|
self::NOTIFICATION_TYPE_SHARE_UNSHARED, |
|
72
|
|
|
self::NOTIFICATION_TYPE_REQUEST_RESHARE, |
|
73
|
|
|
self::NOTIFICATION_TYPE_RESHARE_UNDO, |
|
74
|
|
|
self::NOTIFICATION_TYPE_RESHARE_CHANGE_PERMISSION |
|
75
|
|
|
]; |
|
76
|
|
|
} |
|
77
|
|
|
} |
|
78
|
|
|
|