Skip to content

Commit

Permalink
fixes from code-review
Browse files Browse the repository at this point in the history
  • Loading branch information
christlang committed May 8, 2021
1 parent 010114b commit 70c7173
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/Reminder/INotificationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ interface INotificationProvider {
* @param VEvent $vevent
* @param string $calendarDisplayName
* @param IUser[] $users
* @param IUser $userOfReminder
* @param IUser $reminderOwner
* @return void
*/
public function send(VEvent $vevent,
string $calendarDisplayName,
array $users = [],
IUser $userOfReminder = null): void;
IUser $reminderOwner = null): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ public function __construct(ILogger $logger,
* @param VEvent $vevent
* @param string $calendarDisplayName
* @param IUser[] $users
* @param IUser $userOfReminder
* @param IUser $reminderOwner
* @return void
*/
abstract public function send(VEvent $vevent,
string $calendarDisplayName,
array $users = [],
IUser $userOfReminder = null): void;
IUser $reminderOwner = null): void;

/**
* @return string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ public function __construct(IConfig $config,
* @param VEvent $vevent
* @param string $calendarDisplayName
* @param array $users
* @param IUser $userOfReminder
* @param IUser $reminderOwner
* @throws \Exception
*/
public function send(VEvent $vevent,
string $calendarDisplayName,
array $users = [],
IUser $userOfReminder = null):void {
IUser $reminderOwner = null):void {
$fallbackLanguage = $this->getFallbackLanguage();

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

$emailAddressesOfAttendees = [];

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

Expand Down Expand Up @@ -205,7 +205,7 @@ private function getOrganizerEMailAndNameFromEvent(VEvent $vevent):?array {
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ public function __construct(IConfig $config,
* @param VEvent $vevent
* @param string $calendarDisplayName
* @param IUser[] $users
* @param IUser $userOfReminder
* @param IUser $reminderOwner
* @throws \Exception
*/
public function send(VEvent $vevent,
string $calendarDisplayName = null,
array $users = [],
IUser $userOfReminder = null):void {
IUser $reminderOwner = null):void {
if ($this->config->getAppValue('dav', 'sendEventRemindersPush', 'no') !== 'yes') {
return;
}
Expand Down

0 comments on commit 70c7173

Please sign in to comment.