Skip to content

Commit 6fa8f8b

Browse files
committed
fixes from code-review
1 parent 44a0a54 commit 6fa8f8b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

apps/dav/lib/CalDAV/Reminder/INotificationProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ interface INotificationProvider {
4444
* @param VEvent $vevent
4545
* @param string $calendarDisplayName
4646
* @param IUser[] $users
47-
* @param IUser $userOfReminder
47+
* @param IUser $reminderOwner
4848
* @return void
4949
*/
5050
public function send(VEvent $vevent,
5151
string $calendarDisplayName,
5252
array $users = [],
53-
IUser $userOfReminder = null): void;
53+
IUser $reminderOwner = null): void;
5454
}

apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ public function __construct(ILogger $logger,
9191
* @param VEvent $vevent
9292
* @param string $calendarDisplayName
9393
* @param IUser[] $users
94-
* @param IUser $userOfReminder
94+
* @param IUser $reminderOwner
9595
* @return void
9696
*/
9797
abstract public function send(VEvent $vevent,
9898
string $calendarDisplayName,
9999
array $users = [],
100-
IUser $userOfReminder = null): void;
100+
IUser $reminderOwner = null): void;
101101

102102
/**
103103
* @return string

apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ public function __construct(IConfig $config,
8181
* @param VEvent $vevent
8282
* @param string $calendarDisplayName
8383
* @param array $users
84-
* @param IUser $userOfReminder
84+
* @param IUser $reminderOwner
8585
* @throws \Exception
8686
*/
8787
public function send(VEvent $vevent,
8888
string $calendarDisplayName,
8989
array $users = [],
90-
IUser $userOfReminder = null):void {
90+
IUser $reminderOwner = null):void {
9191
$fallbackLanguage = $this->getFallbackLanguage();
9292

9393
$emailAddressesOfSharees = $this->getEMailAddressesOfAllUsersWithWriteAccessToCalendar($users);
@@ -96,7 +96,7 @@ public function send(VEvent $vevent,
9696

9797
$emailAddressesOfAttendees = [];
9898

99-
if ($userOfReminder && strcasecmp($userOfReminder->getEMailAddress(), key($organizer)) == 0) {
99+
if ($organizer !== null && $reminderOwner instanceof IUser && strcasecmp($reminderOwner->getEMailAddress(), key($organizer)) === 0) {
100100
$emailAddressesOfAttendees = $this->getAllEMailAddressesFromEvent($vevent);
101101
}
102102

@@ -205,7 +205,7 @@ private function getOrganizerEMailAndNameFromEvent(VEvent $vevent):?array {
205205
}
206206

207207
$organizer = $vevent->ORGANIZER;
208-
if (!str_starts_with($organizer->getValue(), 'mailto:')) {
208+
if (strcasecmp($organizer->getValue(), 'mailto:') !== 0) {
209209
return null;
210210
}
211211

apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ public function __construct(IConfig $config,
8383
* @param VEvent $vevent
8484
* @param string $calendarDisplayName
8585
* @param IUser[] $users
86-
* @param IUser $userOfReminder
86+
* @param IUser $reminderOwner
8787
* @throws \Exception
8888
*/
8989
public function send(VEvent $vevent,
9090
string $calendarDisplayName = null,
9191
array $users = [],
92-
IUser $userOfReminder = null):void {
92+
IUser $reminderOwner = null):void {
9393
if ($this->config->getAppValue('dav', 'sendEventRemindersPush', 'no') !== 'yes') {
9494
return;
9595
}

0 commit comments

Comments
 (0)