aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Controller/ShareController.php
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2021-07-29 08:57:31 +0200
committerSimon L. (Rebase PR Action) <szaimen@e.mail.de>2022-03-07 19:50:15 +0000
commitccd08877e803be1281b6c9325219e862c1995f9c (patch)
treeb46b68f6b8b87cb8bcc1201a33f5cde67b7872fd /apps/files_sharing/lib/Controller/ShareController.php
parenta9117d4ef8245c44a9e1ef9a919ea70ea0667cd1 (diff)
downloadnextcloud-server-ccd08877e803be1281b6c9325219e862c1995f9c.tar.gz
nextcloud-server-ccd08877e803be1281b6c9325219e862c1995f9c.zip
Fix too many file download notifications when watching a video
Signed-off-by: szaimen <szaimen@e.mail.de>
Diffstat (limited to 'apps/files_sharing/lib/Controller/ShareController.php')
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 614dae7ffba..411873c9c86 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -729,6 +729,10 @@ class ShareController extends AuthPublicShareController {
$ownerFolder = $this->rootFolder->getUserFolder($share->getShareOwner());
$userPath = $userFolder->getRelativePath($userNode->getPath());
$ownerPath = $ownerFolder->getRelativePath($node->getPath());
+ $remoteAddress = $this->request->getRemoteAddress();
+ $dateTime = new \DateTime();
+ $dateTime = $dateTime->format('Y-m-d H');
+ $remoteAddressHash = md5($dateTime . '-' . $remoteAddress);
$parameters = [$userPath];
@@ -742,8 +746,10 @@ class ShareController extends AuthPublicShareController {
} else {
if ($node instanceof \OCP\Files\File) {
$subject = Downloads::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED;
+ $parameters[] = $remoteAddressHash;
} else {
$subject = Downloads::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED;
+ $parameters[] = $remoteAddressHash;
}
}