Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
use Horde_Imap_Client_Mailbox;

class Folder {
/** @var int */
private $accountId;

/** @var Horde_Imap_Client_Mailbox */
private $mailbox;
Expand All @@ -32,12 +30,10 @@ class Folder {

private ?string $myAcls;

public function __construct(int $accountId,
Horde_Imap_Client_Mailbox $mailbox,
public function __construct(Horde_Imap_Client_Mailbox $mailbox,
array $attributes,
?string $delimiter,
?array $status) {
$this->accountId = $accountId;
$this->mailbox = $mailbox;
$this->attributes = $attributes;
$this->delimiter = $delimiter;
Expand Down
8 changes: 1 addition & 7 deletions lib/Http/Middleware/ProvisioningMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use OCP\Authentication\Exceptions\PasswordUnavailableException;
use OCP\Authentication\LoginCredentials\IStore as ICredentialStore;
use OCP\IUserSession;
use Psr\Log\LoggerInterface;

class ProvisioningMiddleware extends Middleware {
/** @var IUserSession */
Expand All @@ -27,17 +26,12 @@ class ProvisioningMiddleware extends Middleware {
/** @var ProvisioningManager */
private $provisioningManager;

/** @var LoggerInterface */
private $logger;

public function __construct(IUserSession $userSession,
ICredentialStore $credentialStore,
ProvisioningManager $provisioningManager,
LoggerInterface $logger) {
ProvisioningManager $provisioningManager) {
$this->userSession = $userSession;
$this->credentialStore = $credentialStore;
$this->provisioningManager = $provisioningManager;
$this->logger = $logger;
}

#[\Override]
Expand Down
3 changes: 0 additions & 3 deletions lib/IMAP/FolderMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public function getFolders(Account $account, Horde_Imap_Client_Socket $client,
});
return array_map(static function (array $mailbox) use ($account) {
return new Folder(
$account->getId(),
$mailbox['mailbox'],
$mailbox['attributes'],
$mailbox['delimiter'],
Expand All @@ -75,7 +74,6 @@ public function getFolders(Account $account, Horde_Imap_Client_Socket $client,
}

public function createFolder(Horde_Imap_Client_Socket $client,
Account $account,
string $name): Folder {
$client->createMailbox($name);

Expand All @@ -92,7 +90,6 @@ public function createFolder(Horde_Imap_Client_Socket $client,
}

return new Folder(
$account->getId(),
$mb['mailbox'],
$mb['attributes'],
$mb['delimiter'],
Expand Down
4 changes: 0 additions & 4 deletions lib/Listener/NewMessagesSummarizeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@

namespace OCA\Mail\Listener;

use OCA\Mail\Contracts\IMailManager;
use OCA\Mail\Events\NewMessagesSynchronized;
use OCA\Mail\Exception\ServiceException;
use OCA\Mail\IMAP\IMAPClientFactory;
use OCA\Mail\Service\AiIntegrations\AiIntegrationsService;
use OCP\AppFramework\Services\IAppConfig;
use OCP\EventDispatcher\Event;
Expand All @@ -26,9 +24,7 @@ class NewMessagesSummarizeListener implements IEventListener {

public function __construct(
private LoggerInterface $logger,
private IMAPClientFactory $imapFactory,
private AiIntegrationsService $aiService,
private IMailManager $mailManager,
private IAppConfig $appConfig,
) {
}
Expand Down
4 changes: 1 addition & 3 deletions lib/Migration/MigrateImportantFromImapAndDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
use OCA\Mail\Db\MailboxMapper;
use OCA\Mail\Db\Tag;
use OCA\Mail\Exception\ServiceException;
use OCA\Mail\IMAP\IMAPClientFactory;
use OCA\Mail\IMAP\MessageMapper;
use Psr\Log\LoggerInterface;

class MigrateImportantFromImapAndDb {
/** @var IMAPClientFactory */
private $clientFactory;


/** @var MessageMapper */
private $messageMapper;
Expand Down
2 changes: 0 additions & 2 deletions lib/PhishingDetectionList.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class PhishingDetectionList implements JsonSerializable {
/** @var PhishingDetectionResult[] */
private array $checks;

private bool $warning = false;

/**
* @param PhishingDetectionResult[] $checks
*/
Expand Down
7 changes: 0 additions & 7 deletions lib/Service/AvatarService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use OCA\Mail\Service\Avatar\Cache as AvatarCache;
use OCA\Mail\Service\Avatar\CompositeAvatarSource;
use OCA\Mail\Service\Avatar\Downloader;
use OCP\IURLGenerator;

class AvatarService implements IAvatarService {
/** @var AvatarCache */
Expand All @@ -28,9 +27,6 @@ class AvatarService implements IAvatarService {
/** @var CompositeAvatarSource */
private $source;

/** @var IURLGenerator */
private $urlGenerator;

/** @var AvatarFactory */
private $avatarFactory;

Expand All @@ -41,19 +37,16 @@ class AvatarService implements IAvatarService {
* @param CompositeAvatarSource $source
* @param Downloader $downloader
* @param AvatarCache $cache
* @param IURLGenerator $urlGenerator
* @param AvatarFactory $avatarFactory
* @param IUserPreferences $preferences
*/
public function __construct(CompositeAvatarSource $source,
Downloader $downloader,
AvatarCache $cache,
IURLGenerator $urlGenerator,
AvatarFactory $avatarFactory,
IUserPreferences $preferences) {
$this->source = $source;
$this->cache = $cache;
$this->urlGenerator = $urlGenerator;
$this->downloader = $downloader;
$this->avatarFactory = $avatarFactory;
$this->preferences = $preferences;
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/MailManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function getMailboxes(Account $account): array {
public function createMailbox(Account $account, string $name): Mailbox {
$client = $this->imapClientFactory->getClient($account);
try {
$folder = $this->folderMapper->createFolder($client, $account, $name);
$folder = $this->folderMapper->createFolder($client, $name);
$this->folderMapper->fetchFolderAcls([$folder], $client);
} catch (Horde_Imap_Client_Exception $e) {
throw new ServiceException(
Expand Down Expand Up @@ -809,7 +809,7 @@ public function filterFlags(Horde_Imap_Client_Socket $client, Account $account,
if (in_array("\*", $capabilities['permflags']) || in_array($flag, $capabilities['permflags'])) {
return [$flag];
}

return [];
}

Expand Down
6 changes: 1 addition & 5 deletions lib/Service/OutboxService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use OCA\Mail\Account;
use OCA\Mail\Contracts\IMailManager;
use OCA\Mail\Contracts\IMailTransmission;
use OCA\Mail\Db\LocalMessage;
use OCA\Mail\Db\LocalMessageMapper;
use OCA\Mail\Db\Recipient;
Expand All @@ -29,8 +28,7 @@
use Throwable;

class OutboxService {
/** @var IMailTransmission */
private $transmission;


/** @var LocalMessageMapper */
private $mapper;
Expand All @@ -57,7 +55,6 @@ class OutboxService {
private $logger;

public function __construct(
IMailTransmission $transmission,
LocalMessageMapper $mapper,
AttachmentService $attachmentService,
IEventDispatcher $eventDispatcher,
Expand All @@ -68,7 +65,6 @@ public function __construct(
LoggerInterface $logger,
private Chain $sendChain,
) {
$this->transmission = $transmission;
$this->mapper = $mapper;
$this->attachmentService = $attachmentService;
$this->eventDispatcher = $eventDispatcher;
Expand Down
6 changes: 0 additions & 6 deletions lib/Service/Search/MailSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use OCA\Mail\Account;
use OCA\Mail\Contracts\IMailSearch;
use OCA\Mail\Db\Mailbox;
use OCA\Mail\Db\MailboxMapper;
use OCA\Mail\Db\Message;
use OCA\Mail\Db\MessageMapper;
use OCA\Mail\Exception\ClientException;
Expand All @@ -30,9 +29,6 @@ class MailSearch implements IMailSearch {
/** @var FilterStringParser */
private $filterStringParser;

/** @var MailboxMapper */
private $mailboxMapper;

/** @var ImapSearchProvider */
private $imapSearchProvider;

Expand All @@ -46,13 +42,11 @@ class MailSearch implements IMailSearch {
private $timeFactory;

public function __construct(FilterStringParser $filterStringParser,
MailboxMapper $mailboxMapper,
ImapSearchProvider $imapSearchProvider,
MessageMapper $messageMapper,
PreviewEnhancer $previewEnhancer,
ITimeFactory $timeFactory) {
$this->filterStringParser = $filterStringParser;
$this->mailboxMapper = $mailboxMapper;
$this->imapSearchProvider = $imapSearchProvider;
$this->messageMapper = $messageMapper;
$this->previewEnhancer = $previewEnhancer;
Expand Down
3 changes: 0 additions & 3 deletions lib/Service/Search/SearchQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ class SearchQuery {
/** @var string[] */
private $bodies = [];

/** @var string[] */
private $textTokens = [];

/** @var array[] */
private $tags = [];

Expand Down
7 changes: 2 additions & 5 deletions lib/Service/SmimeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use OCA\Mail\Model\SmimeCertificatePurposes;
use OCA\Mail\Model\SmimeDecryptionResult;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\ICertificateManager;
use OCP\ITempManager;
use OCP\Security\ICrypto;
Expand All @@ -41,18 +40,16 @@ class SmimeService {
private ICertificateManager $certificateManager;
private ICrypto $crypto;
private SmimeCertificateMapper $certificateMapper;
private ITimeFactory $timeFactory;


public function __construct(ITempManager $tempManager,
ICertificateManager $certificateManager,
ICrypto $crypto,
SmimeCertificateMapper $certificateMapper,
ITimeFactory $timeFactory) {
SmimeCertificateMapper $certificateMapper) {
$this->tempManager = $tempManager;
$this->certificateManager = $certificateManager;
$this->crypto = $crypto;
$this->certificateMapper = $certificateMapper;
$this->timeFactory = $timeFactory;
}

/**
Expand Down
12 changes: 3 additions & 9 deletions lib/Service/Sync/SyncService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use OCA\Mail\Account;
use OCA\Mail\Contracts\IMailSearch;
use OCA\Mail\Db\Mailbox;
use OCA\Mail\Db\MailboxMapper;
use OCA\Mail\Db\Message;
use OCA\Mail\Db\MessageMapper;
use OCA\Mail\Exception\ClientException;
Expand All @@ -30,7 +29,7 @@
use function array_map;

class SyncService {

private IMAPClientFactory $clientFactory;

/** @var ImapToDbSynchronizer */
Expand All @@ -39,9 +38,6 @@ class SyncService {
/** @var FilterStringParser */
private $filterStringParser;

/** @var MailboxMapper */
private $mailboxMapper;

/** @var MessageMapper */
private $messageMapper;

Expand All @@ -58,15 +54,13 @@ public function __construct(
IMAPClientFactory $clientFactory,
ImapToDbSynchronizer $synchronizer,
FilterStringParser $filterStringParser,
MailboxMapper $mailboxMapper,
MessageMapper $messageMapper,
PreviewEnhancer $previewEnhancer,
LoggerInterface $logger,
MailboxSync $mailboxSync) {
$this->clientFactory = $clientFactory;
$this->synchronizer = $synchronizer;
$this->filterStringParser = $filterStringParser;
$this->mailboxMapper = $mailboxMapper;
$this->messageMapper = $messageMapper;
$this->previewEnhancer = $previewEnhancer;
$this->logger = $logger;
Expand Down Expand Up @@ -120,9 +114,9 @@ public function syncMailbox(Account $account,
if ($partialOnly && !$mailbox->isCached()) {
throw MailboxNotCachedException::from($mailbox);
}

$client = $this->clientFactory->getClient($account);

$this->synchronizer->sync(
$account,
$client,
Expand Down
2 changes: 0 additions & 2 deletions lib/SetupChecks/MailConnectionPerformance.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use OCA\Mail\Db\MailAccountMapper;
use OCA\Mail\Db\ProvisioningMapper;
use OCA\Mail\Exception\ServiceException;
use OCA\Mail\IMAP\FolderMapper;
use OCA\Mail\IMAP\IMAPClientFactory;
use OCP\IL10N;
use OCP\SetupCheck\ISetupCheck;
Expand All @@ -28,7 +27,6 @@ public function __construct(
private ProvisioningMapper $provisioningMapper,
private MailAccountMapper $accountMapper,
private IMAPClientFactory $clientFactory,
private FolderMapper $folderMapper,
private MicroTime $microtime,
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use OCA\Mail\Account;
use OCA\Mail\Contracts\IAttachmentService;
use OCA\Mail\Contracts\IMailManager;
use OCA\Mail\Contracts\IMailTransmission;
use OCA\Mail\Db\LocalAttachmentMapper;
use OCA\Mail\Db\LocalMessage;
use OCA\Mail\Db\LocalMessageMapper;
Expand Down Expand Up @@ -57,9 +56,6 @@ class OutboxServiceIntegrationTest extends TestCase {
/** @var IAttachmentService */
private $attachmentService;

/** @var IMailTransmission */
private $transmission;

/** @var OutboxService */
private $outbox;

Expand Down Expand Up @@ -105,7 +101,6 @@ protected function setUp(): void {
);
$this->client = $this->getClient($this->account);
$this->mapper = Server::get(LocalMessageMapper::class);
$this->transmission = Server::get(IMailTransmission::class);
$this->eventDispatcher = Server::get(IEventDispatcher::class);
$this->clientFactory = Server::get(IMAPClientFactory::class);
$this->accountService = Server::get(AccountService::class);
Expand All @@ -117,7 +112,7 @@ protected function setUp(): void {
$delete = $qb->delete($this->mapper->getTableName());
$delete->execute();

$this->outbox = new OutboxService($this->transmission,
$this->outbox = new OutboxService(
$this->mapper,
$this->attachmentService,
$this->eventDispatcher,
Expand Down
Loading