|
@@ 322-327 (lines=6) @@
|
| 319 |
|
} |
| 320 |
|
// TODO: check permissions/preconditions in all cases |
| 321 |
|
switch ($notificationType) { |
| 322 |
|
case FileNotification::NOTIFICATION_TYPE_SHARE_ACCEPTED: |
| 323 |
|
$share = $this->getValidShare( |
| 324 |
|
$providerId, $notification['sharedSecret'] |
| 325 |
|
); |
| 326 |
|
$this->fedShareManager->acceptShare($share); |
| 327 |
|
break; |
| 328 |
|
case FileNotification::NOTIFICATION_TYPE_SHARE_DECLINED: |
| 329 |
|
$share = $this->getValidShare( |
| 330 |
|
$providerId, $notification['sharedSecret'] |
|
@@ 328-333 (lines=6) @@
|
| 325 |
|
); |
| 326 |
|
$this->fedShareManager->acceptShare($share); |
| 327 |
|
break; |
| 328 |
|
case FileNotification::NOTIFICATION_TYPE_SHARE_DECLINED: |
| 329 |
|
$share = $this->getValidShare( |
| 330 |
|
$providerId, $notification['sharedSecret'] |
| 331 |
|
); |
| 332 |
|
$this->fedShareManager->declineShare($share); |
| 333 |
|
break; |
| 334 |
|
case FileNotification::NOTIFICATION_TYPE_REQUEST_RESHARE: |
| 335 |
|
$shareWithAddress = new Address($notification['shareWith']); |
| 336 |
|
$localShareWith = $shareWithAddress->getUserId(); |
|
@@ 365-370 (lines=6) @@
|
| 362 |
|
$providerId, $notification['sharedSecret'] |
| 363 |
|
); |
| 364 |
|
break; |
| 365 |
|
case FileNotification::NOTIFICATION_TYPE_RESHARE_UNDO: |
| 366 |
|
$share = $this->getValidShare( |
| 367 |
|
$providerId, $notification['sharedSecret'] |
| 368 |
|
); |
| 369 |
|
$this->fedShareManager->revoke($share); |
| 370 |
|
break; |
| 371 |
|
default: |
| 372 |
|
return new JSONResponse( |
| 373 |
|
['message' => "Notification of type {$notificationType} is not supported"], |