Skip to content

Commit

Permalink
chore: remove some obsolete server version checks
Browse files Browse the repository at this point in the history
We only support >= 30 by now.

Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny committed Nov 12, 2024
1 parent cdbbd5a commit ba9168b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 31 deletions.
25 changes: 6 additions & 19 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,32 +130,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);

Check warning on line 137 in lib/AppInfo/Application.php

View check run for this annotation

Codecov / codecov/patch

lib/AppInfo/Application.php#L133-L137

Added lines #L133 - L137 were not covered by tests

$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);

Check warning on line 145 in lib/AppInfo/Application.php

View check run for this annotation

Codecov / codecov/patch

lib/AppInfo/Application.php#L145

Added line #L145 was not covered by tests

// 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 ba9168b

Please sign in to comment.