Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/event_update_notification.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-08-28 15:58:59 +0300
committerJoas Schilling <coding@schilljs.com>2020-08-28 16:00:15 +0300
commit311870e657630d34690484c9863280c86b00e846 (patch)
tree553de60eda6550b22f0da3a9f163d6ca8a55657f
parentf63511ae8627ef370e701371d1308d7364417de8 (diff)
Only send notifications once to the ownerbugfix/noid/nextcloud-20
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/EventListener.php9
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') {