fix notification when a group share is received
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
4c00c80a83
commit
7a48a85dca
|
@ -235,20 +235,26 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
|
|||
$externalManager->addShare($remote, $token, '', $name, $owner, $shareType,false, $shareWith, $remoteId);
|
||||
$shareId = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*share_external');
|
||||
|
||||
$event = $this->activityManager->generateEvent();
|
||||
$event->setApp('files_sharing')
|
||||
->setType('remote_share')
|
||||
->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')])
|
||||
->setAffectedUser($shareWith)
|
||||
->setObject('remote_share', (int)$shareId, $name);
|
||||
\OC::$server->getActivityManager()->publish($event);
|
||||
|
||||
if ($shareType === Share::SHARE_TYPE_USER) {
|
||||
$event = $this->activityManager->generateEvent();
|
||||
$event->setApp('files_sharing')
|
||||
->setType('remote_share')
|
||||
->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')])
|
||||
->setAffectedUser($shareWith)
|
||||
->setObject('remote_share', (int)$shareId, $name);
|
||||
\OC::$server->getActivityManager()->publish($event);
|
||||
$this->notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name);
|
||||
} else {
|
||||
$groupMembers = $this->groupManager->get($shareWith)->getUsers();
|
||||
foreach ($groupMembers as $user) {
|
||||
$this->notifyAboutNewShare($user, $shareId, $ownerFederatedId, $sharedByFederatedId, $name);
|
||||
$event = $this->activityManager->generateEvent();
|
||||
$event->setApp('files_sharing')
|
||||
->setType('remote_share')
|
||||
->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')])
|
||||
->setAffectedUser($user->getUID())
|
||||
->setObject('remote_share', (int)$shareId, $name);
|
||||
\OC::$server->getActivityManager()->publish($event);
|
||||
$this->notifyAboutNewShare($user->getUID(), $shareId, $ownerFederatedId, $sharedByFederatedId, $name);
|
||||
}
|
||||
}
|
||||
return $shareId;
|
||||
|
|
Loading…
Reference in New Issue