@@ -355,7 +355,16 @@ public function fileMove($oldPath, $newPath) {
355355 $ this ->moveCase = false ;
356356 return ;
357357 }
358- $ this ->oldAccessList = $ this ->getUserPathsFromPath ($ this ->oldParentPath , $ this ->oldParentOwner );
358+
359+ $ oldAccessList = $ this ->getUserPathsFromPath ($ this ->oldParentPath , $ this ->oldParentOwner );
360+
361+ // file can be shared using GroupFolders, including ACL check
362+ if ($ this ->config ->getSystemValueBool ('activity_use_cached_mountpoints ' , false )) {
363+ [, , $ oldFileId ] = $ this ->getSourcePathAndOwner ($ oldPath );
364+ $ oldAccessList ['users ' ] = array_merge ($ oldAccessList ['users ' ], $ this ->getAffectedUsersFromCachedMounts ($ oldFileId ));
365+ }
366+
367+ $ this ->oldAccessList = $ oldAccessList ;
359368 }
360369
361370
@@ -416,6 +425,12 @@ protected function fileRenaming($oldPath, $newPath) {
416425 $ this ->generateRemoteActivity ($ renameRemotes , Files::TYPE_FILE_CHANGED , time (), $ this ->currentUser ->getCloudId ());
417426
418427 $ affectedUsers = $ accessList ['users ' ];
428+
429+ // file can be shared using GroupFolders, including ACL check
430+ if ($ this ->config ->getSystemValueBool ('activity_use_cached_mountpoints ' , false )) {
431+ $ affectedUsers = array_merge ($ affectedUsers , $ this ->getAffectedUsersFromCachedMounts ($ fileId ));
432+ }
433+
419434 [$ filteredEmailUsers , $ filteredNotificationUsers ] = $ this ->getFileChangeActivitySettings ($ fileId , array_keys ($ affectedUsers ));
420435
421436 foreach ($ affectedUsers as $ user => $ path ) {
@@ -465,6 +480,12 @@ protected function fileMoving($oldPath, $newPath) {
465480 $ affectedUsers = $ accessList ['users ' ];
466481 $ oldUsers = $ this ->oldAccessList ['users ' ];
467482
483+ // file can be shared using GroupFolders, including ACL check
484+ if ($ this ->config ->getSystemValueBool ('activity_use_cached_mountpoints ' , false )) {
485+ $ this ->userMountCache ->clear (); // clear cache for new data
486+ $ affectedUsers = array_merge ($ affectedUsers , $ this ->getAffectedUsersFromCachedMounts ($ fileId ));
487+ }
488+
468489 $ beforeUsers = array_keys ($ oldUsers );
469490 $ afterUsers = array_keys ($ affectedUsers );
470491
0 commit comments