From 8f15e2d57a6322f682a2f1dfda4f52ee3a70f107 Mon Sep 17 00:00:00 2001
From: Roeland Jago Douma <roeland@famdouma.nl>
Date: Fri, 24 Jan 2020 12:43:17 +0100
Subject: [PATCH] Use the target for file notifications

The node is not yet accessible if you did not accept the share yet.
So trying to get it results in an acception.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
---
 apps/files_sharing/lib/Notification/Notifier.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/files_sharing/lib/Notification/Notifier.php b/apps/files_sharing/lib/Notification/Notifier.php
index 6cfa45a649c..a47b04e5b14 100644
--- a/apps/files_sharing/lib/Notification/Notifier.php
+++ b/apps/files_sharing/lib/Notification/Notifier.php
@@ -176,7 +176,7 @@ class Notifier implements INotifier {
 					'share' => [
 						'type' => 'highlight',
 						'id' => $notification->getObjectId(),
-						'name' => $share->getNode()->getName(),
+						'name' => $share->getTarget(),
 					],
 					'user' =>  [
 						'type' => 'user',
@@ -212,7 +212,7 @@ class Notifier implements INotifier {
 					'share' => [
 						'type' => 'highlight',
 						'id' => $notification->getObjectId(),
-						'name' => $share->getNode()->getName(),
+						'name' => $share->getTarget(),
 					],
 					'group' => [
 						'type' => 'user-group',
-- 
GitLab