Skip to content

Commit

Permalink
Merge pull request #10349 from nextcloud/chore/remove-version-gates
Browse files Browse the repository at this point in the history
chore: remove some obsolete server version checks
  • Loading branch information
kesselb authored Nov 12, 2024
2 parents fd27467 + 4c73df9 commit 1f5ab27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 34 deletions.
28 changes: 6 additions & 22 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
use OCA\Mail\Notification\Notifier;
use OCA\Mail\Provider\MailProvider;
use OCA\Mail\Search\FilteringProvider;
use OCA\Mail\Search\Provider;
use OCA\Mail\Service\Attachment\AttachmentService;
use OCA\Mail\Service\AvatarService;
use OCA\Mail\Service\DkimService;
Expand All @@ -71,7 +70,6 @@
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\DB\Events\AddMissingIndicesEvent;
use OCP\IServerContainer;
use OCP\Search\IFilteringProvider;
use OCP\User\Events\OutOfOfficeChangedEvent;
use OCP\User\Events\OutOfOfficeClearedEvent;
use OCP\User\Events\OutOfOfficeEndedEvent;
Expand All @@ -80,7 +78,6 @@
use OCP\User\Events\UserDeletedEvent;
use OCP\Util;
use Psr\Container\ContainerInterface;
use function interface_exists;

include_once __DIR__ . '/../../vendor/autoload.php';

Expand Down Expand Up @@ -130,32 +127,19 @@ public function register(IRegistrationContext $context): void {
$context->registerEventListener(SynchronizationEvent::class, AccountSynchronizedThreadUpdaterListener::class);
$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
$context->registerEventListener(NewMessagesSynchronized::class, FollowUpClassifierListener::class);

// TODO: drop condition if nextcloud < 28 is not supported anymore
if (class_exists(OutOfOfficeStartedEvent::class)
&& class_exists(OutOfOfficeEndedEvent::class)
&& class_exists(OutOfOfficeChangedEvent::class)
&& class_exists(OutOfOfficeClearedEvent::class)
&& class_exists(OutOfOfficeScheduledEvent::class)
) {
$context->registerEventListener(OutOfOfficeStartedEvent::class, OutOfOfficeListener::class);
$context->registerEventListener(OutOfOfficeEndedEvent::class, OutOfOfficeListener::class);
$context->registerEventListener(OutOfOfficeChangedEvent::class, OutOfOfficeListener::class);
$context->registerEventListener(OutOfOfficeClearedEvent::class, OutOfOfficeListener::class);
$context->registerEventListener(OutOfOfficeScheduledEvent::class, OutOfOfficeListener::class);
}
$context->registerEventListener(OutOfOfficeStartedEvent::class, OutOfOfficeListener::class);
$context->registerEventListener(OutOfOfficeEndedEvent::class, OutOfOfficeListener::class);
$context->registerEventListener(OutOfOfficeChangedEvent::class, OutOfOfficeListener::class);
$context->registerEventListener(OutOfOfficeClearedEvent::class, OutOfOfficeListener::class);
$context->registerEventListener(OutOfOfficeScheduledEvent::class, OutOfOfficeListener::class);

$context->registerMiddleWare(ErrorMiddleware::class);
$context->registerMiddleWare(ProvisioningMiddleware::class);

$context->registerDashboardWidget(ImportantMailWidget::class);
$context->registerDashboardWidget(UnreadMailWidget::class);

if (interface_exists(IFilteringProvider::class)) {
$context->registerSearchProvider(FilteringProvider::class);
} else {
$context->registerSearchProvider(Provider::class);
}
$context->registerSearchProvider(FilteringProvider::class);

// Added in version 4.0.0
$context->registerMailProvider(MailProvider::class);
Expand Down
6 changes: 0 additions & 6 deletions src/components/MailboxThread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,6 @@ export default {
* @return {boolean}
*/
hasFollowUpEnvelopes() {
// TODO: remove this version check once we only support >= 27.1
const [major, minor] = OC.config.version.split('.').map(parseInt)
if (major < 27 || (major === 27 && minor < 1)) {
return false
}

if (!this.followUpQuery) {
return false
}
Expand Down
6 changes: 0 additions & 6 deletions src/components/ThreadEnvelope.vue
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,6 @@ export default {
* @return {boolean}
*/
showFollowUpHeader() {
// TODO: remove this version check once we only support >= 27.1
const [major, minor] = OC.config.version.split('.').map(parseInt)
if (major < 27 || (major === 27 && minor < 1)) {
return false
}

const tags = this.$store.getters.getEnvelopeTags(this.envelope.databaseId)
return tags.some((tag) => tag.imapLabel === FOLLOW_UP_TAG_LABEL)
},
Expand Down

0 comments on commit 1f5ab27

Please sign in to comment.