Merge pull request #2267 from nextcloud/issue-2254-react-to-remote-share-activities-only

Only do stuff when its a remote-share activity
This commit is contained in:
Lukas Reschke 2016-11-23 12:16:55 +01:00 committed by GitHub
commit 10cc849dbc
1 changed files with 3 additions and 2 deletions

View File

@ -159,10 +159,10 @@ class RemoteShares implements IProvider {
$subject = $event->getSubject(); $subject = $event->getSubject();
$parameters = $event->getSubjectParameters(); $parameters = $event->getSubjectParameters();
$remoteUser = explode('@', $parameters[0], 2);
switch ($subject) { switch ($subject) {
case self::SUBJECT_REMOTE_SHARE_RECEIVED: case self::SUBJECT_REMOTE_SHARE_RECEIVED:
case self::SUBJECT_REMOTE_SHARE_UNSHARED: case self::SUBJECT_REMOTE_SHARE_UNSHARED:
$remoteUser = explode('@', $parameters[0], 2);
return [ return [
'file' => [ 'file' => [
'type' => 'pending-federated-share', 'type' => 'pending-federated-share',
@ -178,6 +178,7 @@ class RemoteShares implements IProvider {
]; ];
case self::SUBJECT_REMOTE_SHARE_ACCEPTED: case self::SUBJECT_REMOTE_SHARE_ACCEPTED:
case self::SUBJECT_REMOTE_SHARE_DECLINED: case self::SUBJECT_REMOTE_SHARE_DECLINED:
$remoteUser = explode('@', $parameters[0], 2);
return [ return [
'file' => $this->generateFileParameter($event->getObjectId(), $event->getObjectName()), 'file' => $this->generateFileParameter($event->getObjectId(), $event->getObjectName()),
'user' => [ 'user' => [
@ -188,7 +189,7 @@ class RemoteShares implements IProvider {
], ],
]; ];
} }
return []; throw new \InvalidArgumentException();
} }
/** /**