Skip to content

Commit

Permalink
Remove /user/files prefix from paths in comment activities
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Jun 26, 2023
1 parent e2616c3 commit ae378e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/comments/lib/Activity/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public function commentEvent(CommentsEvent $event): void {
$users = [];
$filesPerUser = $cache->getFilesByUserId((int)$event->getComment()->getObjectId());
foreach ($filesPerUser as $user => $files) {
$users[$user] = reset($files)?->getPath();
/* Remove /user/files prefix */
$sections = explode('/', reset($files)?->getPath() ?? '', 4);
$users[$user] = '/'.($sections[3] ?? '');
}

$actor = $this->session->getUser();
Expand Down

0 comments on commit ae378e5

Please sign in to comment.