Skip to content

Commit 232757b

Browse files
committed
groupfolder activities on move/rename
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent dcb12e4 commit 232757b

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

lib/FilesHooks.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,16 @@ public function fileMove($oldPath, $newPath) {
354354
$this->moveCase = false;
355355
return;
356356
}
357-
$this->oldAccessList = $this->getUserPathsFromPath($this->oldParentPath, $this->oldParentOwner);
357+
358+
$oldAccessList = $this->getUserPathsFromPath($this->oldParentPath, $this->oldParentOwner);
359+
360+
// file can be shared using GroupFolders, including ACL check
361+
if ($this->config->getSystemValueBool('activity_use_cached_mountpoints', false)) {
362+
[, , $oldFileId] = $this->getSourcePathAndOwner($oldPath);
363+
$oldAccessList['users'] = array_merge($oldAccessList['users'], $this->getAffectedUsersFromCachedMounts($oldFileId));
364+
}
365+
366+
$this->oldAccessList = $oldAccessList;
358367
}
359368

360369

@@ -415,6 +424,12 @@ protected function fileRenaming($oldPath, $newPath) {
415424
$this->generateRemoteActivity($renameRemotes, Files::TYPE_FILE_CHANGED, time(), $this->currentUser->getCloudId());
416425

417426
$affectedUsers = $accessList['users'];
427+
428+
// file can be shared using GroupFolders, including ACL check
429+
if ($this->config->getSystemValueBool('activity_use_cached_mountpoints', false)) {
430+
$affectedUsers = array_merge($affectedUsers, $this->getAffectedUsersFromCachedMounts($fileId));
431+
}
432+
418433
[$filteredEmailUsers, $filteredNotificationUsers] = $this->getFileChangeActivitySettings($fileId, array_keys($affectedUsers));
419434

420435
foreach ($affectedUsers as $user => $path) {
@@ -464,6 +479,12 @@ protected function fileMoving($oldPath, $newPath) {
464479
$affectedUsers = $accessList['users'];
465480
$oldUsers = $this->oldAccessList['users'];
466481

482+
// file can be shared using GroupFolders, including ACL check
483+
if ($this->config->getSystemValueBool('activity_use_cached_mountpoints', false)) {
484+
$this->userMountCache->clear(); // clear cache for new data
485+
$affectedUsers = array_merge($affectedUsers, $this->getAffectedUsersFromCachedMounts($fileId));
486+
}
487+
467488
$beforeUsers = array_keys($oldUsers);
468489
$afterUsers = array_keys($affectedUsers);
469490

0 commit comments

Comments
 (0)