fixes from code-review

This commit is contained in:
lange 2021-05-08 13:22:37 +02:00
parent 010114b887
commit 70c7173020
4 changed files with 10 additions and 10 deletions

View File

@ -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;
}

View File

@ -91,13 +91,13 @@ abstract class AbstractProvider implements INotificationProvider {
* @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

View File

@ -81,13 +81,13 @@ class EmailProvider extends AbstractProvider {
* @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);
@ -96,7 +96,7 @@ class EmailProvider extends AbstractProvider {
$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);
}
@ -205,7 +205,7 @@ class EmailProvider extends AbstractProvider {
}
$organizer = $vevent->ORGANIZER;
if (!str_starts_with($organizer->getValue(), 'mailto:')) {
if (strcasecmp($organizer->getValue(), 'mailto:') !== 0) {
return null;
}

View File

@ -83,13 +83,13 @@ class PushProvider extends AbstractProvider {
* @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;
}