diff options
author | SebastianKrupinski <krupinskis05@gmail.com> | 2024-09-17 07:45:44 -0400 |
---|---|---|
committer | SebastianKrupinski <krupinskis05@gmail.com> | 2024-11-12 13:19:35 -0500 |
commit | 3e870695bc4989e5e2c6f59c44ed5dbd501a7673 (patch) | |
tree | 73083164c8d239499610d71f063a4aaae50a7191 /apps/dav/lib | |
parent | de1c175d39f2513f3a99e393c9ea70175e43ae10 (diff) | |
download | nextcloud-server-3e870695bc4989e5e2c6f59c44ed5dbd501a7673.tar.gz nextcloud-server-3e870695bc4989e5e2c6f59c44ed5dbd501a7673.zip |
feat: mail provider settingsfeat/mail-provider-settings
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
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), |