effectively revert 17fae47bdb fixing i10n

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2020-08-03 11:05:45 +02:00
parent f13d5a3ec0
commit c6becac993
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 4 additions and 13 deletions

View File

@ -255,7 +255,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
->setAffectedUser($shareWith) ->setAffectedUser($shareWith)
->setObject('remote_share', (int)$shareId, $name); ->setObject('remote_share', (int)$shareId, $name);
\OC::$server->getActivityManager()->publish($event); \OC::$server->getActivityManager()->publish($event);
$this->notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $sharedBy, $owner); $this->notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name);
} else { } else {
$groupMembers = $this->groupManager->get($shareWith)->getUsers(); $groupMembers = $this->groupManager->get($shareWith)->getUsers();
foreach ($groupMembers as $user) { foreach ($groupMembers as $user) {
@ -266,7 +266,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
->setAffectedUser($user->getUID()) ->setAffectedUser($user->getUID())
->setObject('remote_share', (int)$shareId, $name); ->setObject('remote_share', (int)$shareId, $name);
\OC::$server->getActivityManager()->publish($event); \OC::$server->getActivityManager()->publish($event);
$this->notifyAboutNewShare($user->getUID(), $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $sharedBy, $owner); $this->notifyAboutNewShare($user->getUID(), $shareId, $ownerFederatedId, $sharedByFederatedId, $name);
} }
} }
return $shareId; return $shareId;
@ -332,22 +332,13 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
return $result; return $result;
} }
/** private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name): void {
* notify user about new federated share
*
* @param $shareWith
* @param $shareId
* @param $ownerFederatedId
* @param $sharedByFederatedId
* @param $name
*/
private function notifyAboutNewShare($shareWith, $shareId, $ownerFederatedId, $sharedByFederatedId, $name, $sharedBy, $owner) {
$notification = $this->notificationManager->createNotification(); $notification = $this->notificationManager->createNotification();
$notification->setApp('files_sharing') $notification->setApp('files_sharing')
->setUser($shareWith) ->setUser($shareWith)
->setDateTime(new \DateTime()) ->setDateTime(new \DateTime())
->setObject('remote_share', $shareId) ->setObject('remote_share', $shareId)
->setSubject('remote_share', [$ownerFederatedId, $sharedByFederatedId, trim($name, '/'), $sharedBy, $owner]); ->setSubject('remote_share', [$ownerFederatedId, $sharedByFederatedId, trim($name, '/')]);
$declineAction = $notification->createAction(); $declineAction = $notification->createAction();
$declineAction->setLabel('decline') $declineAction->setLabel('decline')