Skip to content

Commit

Permalink
feature: mail provider backend
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Jun 7, 2024
1 parent 0903848 commit 43d6666
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions apps/dav/lib/CalDAV/Schedule/IMipPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use OCP\IConfig;
use OCP\IUserSession;
use OCP\Mail\IMailer;
use OCP\Mail\Provider\IMessageSend;
use OCP\Util;
use Psr\Log\LoggerInterface;
use Sabre\CalDAV\Schedule\IMipPlugin as SabreIMipPlugin;
Expand Down Expand Up @@ -263,7 +264,7 @@ public function schedule(Message $iTipMessage) {
// retrieve all services
$mailService = $mailManager->findServiceByAddress($this->userSession->getUser()->getUID(), $sender);

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getUID on possibly null value
// evaluate if a mail service was found and has sending capabilities
if ($mailService !== null && $mailService->capable('MessageSend')) {
if ($mailService !== null && $mailService instanceof IMessageSend) {
// construct mail provider message and set required parameters
$message = new \OCP\Mail\Provider\Message();
$message->setFrom(
Expand All @@ -281,7 +282,8 @@ public function schedule(Message $iTipMessage) {
'text/calendar; method=' . $iTipMessage->method,
true
)));
$failed = $mailService->messageSend($message);
// send message
$mailService->messageSend($message);
} else {
// construct symfony mailer message and set required parameters
$message = $this->mailer->createMessage();
Expand Down
4 changes: 2 additions & 2 deletions lib/private/AppFramework/Bootstrap/RegistrationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,10 @@ public function registerTaskProcessingTaskType(string $taskProcessingTaskTypeCla
);
}

public function registerMailProvider(string $mailProviderClass): void {
public function registerMailProvider(string $class): void {
$this->context->registerMailProvider(
$this->appId,
$mailProviderClass
$class
);
}
};
Expand Down

0 comments on commit 43d6666

Please sign in to comment.