Merge pull request #18457 from nextcloud/fix/sharing/notifier/uid

Use the user from the notification
This commit is contained in:
Roeland Jago Douma 2019-12-18 13:16:06 +01:00 committed by GitHub
commit c44fd46c8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 7 deletions

View File

@ -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;
}
/**
@ -117,7 +112,7 @@ class Notifier implements INotifier {
$attemptId = $notification->getObjectId();
try {
$share = $this->shareManager->getShareById($attemptId, $this->userId);
$share = $this->shareManager->getShareById($attemptId, $notification->getUser());
} catch (ShareNotFound $e) {
throw new AlreadyProcessedException();
}