Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use the user from the notification
Signed-off-by: Roeland Jago Douma <[email protected]>
  • Loading branch information
rullzer committed Dec 18, 2019
commit b86990988ef676b3c09eb8403745e484c9d954e4
9 changes: 2 additions & 7 deletions apps/files_sharing/lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,19 @@ class Notifier implements INotifier {
protected $userManager;
/** @var IURLGenerator */
protected $url;
/** @var string */
private $userId;


public function __construct(IFactory $l10nFactory,
IManager $shareManager,
IRootFolder $rootFolder,
IGroupManager $groupManager,
IUserManager $userManager,
IURLGenerator $url,
string $userId) {
IURLGenerator $url) {
$this->l10nFactory = $l10nFactory;
$this->shareManager = $shareManager;
$this->rootFolder = $rootFolder;
$this->groupManager = $groupManager;
$this->userManager = $userManager;
$this->url = $url;
$this->userId = $userId;
}

/**
Expand Down Expand Up @@ -117,7 +112,7 @@ public function prepare(INotification $notification, string $languageCode): INot
$attemptId = $notification->getObjectId();

try {
$share = $this->shareManager->getShareById($attemptId, $this->userId);
$share = $this->shareManager->getShareById($attemptId, $notification->getUser());
} catch (ShareNotFound $e) {
throw new AlreadyProcessedException();
}
Expand Down