diff options
author | Daniel <mail@danielkesselberg.de> | 2024-11-13 14:31:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-13 14:31:21 +0100 |
commit | 22e2419b2828c5866a32c9da43cbaa8c8a2898ea (patch) | |
tree | 9006039832362b6080c199791f00539e538d4955 /apps/dav/lib | |
parent | 423f57677f2b2e9d71277f6dc89a7698a1f92ea8 (diff) | |
parent | 3e870695bc4989e5e2c6f59c44ed5dbd501a7673 (diff) | |
download | nextcloud-server-22e2419b2828c5866a32c9da43cbaa8c8a2898ea.tar.gz nextcloud-server-22e2419b2828c5866a32c9da43cbaa8c8a2898ea.zip |
Merge pull request #48134 from nextcloud/feat/mail-provider-settings
feat: mail provider settings
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/CalDAV/Schedule/IMipPlugin.php | 20 | ||||
-rw-r--r-- | apps/dav/lib/Server.php | 3 |
2 files changed, 13 insertions, 10 deletions
diff --git a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php index 084d7201933..d81d85573fc 100644 --- a/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php +++ b/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php @@ -12,7 +12,7 @@ use OCA\DAV\CalDAV\CalendarObject; use OCA\DAV\CalDAV\EventComparisonService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Defaults; -use OCP\IConfig; +use OCP\IAppConfig; use OCP\IUserSession; use OCP\Mail\IMailer; use OCP\Mail\Provider\Address; @@ -45,6 +45,7 @@ use Sabre\VObject\Reader; * @license http://sabre.io/license/ Modified BSD License */ class IMipPlugin extends SabreIMipPlugin { + private ?VCalendar $vCalendar = null; public const MAX_DATE = '2038-01-01'; public const METHOD_REQUEST = 'request'; @@ -53,7 +54,7 @@ class IMipPlugin extends SabreIMipPlugin { public const IMIP_INDENT = 15; public function __construct( - private IConfig $config, + private IAppConfig $config, private IMailer $mailer, private LoggerInterface $logger, private ITimeFactory $timeFactory, @@ -240,7 +241,7 @@ class IMipPlugin extends SabreIMipPlugin { */ $recipientDomain = substr(strrchr($recipient, '@'), 1); - $invitationLinkRecipients = explode(',', preg_replace('/\s+/', '', strtolower($this->config->getAppValue('dav', 'invitation_link_recipients', 'yes')))); + $invitationLinkRecipients = explode(',', preg_replace('/\s+/', '', strtolower($this->config->getValueString('dav', 'invitation_link_recipients', 'yes')))); if (strcmp('yes', $invitationLinkRecipients[0]) === 0 || in_array(strtolower($recipient), $invitationLinkRecipients) @@ -259,12 +260,13 @@ class IMipPlugin extends SabreIMipPlugin { $mailService = null; try { - // retrieve user object - $user = $this->userSession->getUser(); - // evaluate if user object exist - if ($user !== null) { - // retrieve appropriate service with the same address as sender - $mailService = $this->mailManager->findServiceByAddress($user->getUID(), $sender); + if ($this->config->getValueBool('core', 'mail_providers_enabled', true)) { + // retrieve user object + $user = $this->userSession->getUser(); + if ($user !== null) { + // retrieve appropriate service with the same address as sender + $mailService = $this->mailManager->findServiceByAddress($user->getUID(), $sender); + } } // evaluate if a mail service was found and has sending capabilities if ($mailService !== null && $mailService instanceof IMessageSend) { diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php index 835a13a45b2..0dfdd43bf0c 100644 --- a/apps/dav/lib/Server.php +++ b/apps/dav/lib/Server.php @@ -70,6 +70,7 @@ use OCP\Diagnostics\IEventLogger; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\IFilenameValidator; use OCP\FilesMetadata\IFilesMetadataManager; +use OCP\IAppConfig; use OCP\ICacheFactory; use OCP\IConfig; use OCP\IPreview; @@ -311,7 +312,7 @@ class Server { )); if (\OC::$server->getConfig()->getAppValue('dav', 'sendInvitations', 'yes') === 'yes') { $this->server->addPlugin(new IMipPlugin( - \OC::$server->get(IConfig::class), + \OC::$server->get(IAppConfig::class), \OC::$server->get(IMailer::class), \OC::$server->get(LoggerInterface::class), \OC::$server->get(ITimeFactory::class), |