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

View file

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