diff options
author | Joas Schilling <coding@schilljs.com> | 2020-08-28 15:58:59 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-08-28 16:00:15 +0300 |
commit | 311870e657630d34690484c9863280c86b00e846 (patch) | |
tree | 553de60eda6550b22f0da3a9f163d6ca8a55657f | |
parent | f63511ae8627ef370e701371d1308d7364417de8 (diff) |
Only send notifications once to the ownerbugfix/noid/nextcloud-20
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | lib/EventListener.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/EventListener.php b/lib/EventListener.php index 51e0c76..d78c427 100644 --- a/lib/EventListener.php +++ b/lib/EventListener.php @@ -129,8 +129,7 @@ class EventListener implements IEventListener { 'hasTime' => $hasTime, ]); - $users = $this->getUsersForShares($shares); - $users[] = $owner; + $users = $this->getUsersForShares($shares, $owner); foreach ($users as $user) { if ($user === $currentUser) { @@ -193,10 +192,12 @@ class EventListener implements IEventListener { * Get all users that have access to a given calendar * * @param array $shares + * @param string $owner * @return string[] */ - protected function getUsersForShares(array $shares): array { - $users = $groups = []; + protected function getUsersForShares(array $shares, string $owner): array { + $users = [$owner]; + $groups = []; foreach ($shares as $share) { $prinical = explode('/', $share['{http://owncloud.org/ns}principal']); if ($prinical[1] === 'users') { |