From fb8408c3da2b99ab1d6044f214893d76d5730499 Mon Sep 17 00:00:00 2001 From: Benoit Marty <benoit@matrix.org> Date: Wed, 1 Jun 2022 16:45:02 +0200 Subject: [PATCH] Small cleanup --- .../im/vector/app/core/pushers/UnifiedPushHelper.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt b/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt index 3fcd252760..312cd866f8 100644 --- a/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt +++ b/vector/src/main/java/im/vector/app/core/pushers/UnifiedPushHelper.kt @@ -246,9 +246,8 @@ class UnifiedPushHelper @Inject constructor( } fun getExternalDistributors(): List<String> { - val distributors = up.getDistributors(context).toMutableList() - distributors.remove(context.packageName) - return distributors + return up.getDistributors(context) + .filterNot { it == context.packageName } } fun getCurrentDistributorName(): String { @@ -268,13 +267,11 @@ class UnifiedPushHelper @Inject constructor( } fun isEmbeddedDistributor(): Boolean { - return (up.getDistributor(context) == context.packageName && - FcmHelper.isPushSupported()) + return up.getDistributor(context) == context.packageName && FcmHelper.isPushSupported() } fun isBackgroundSync(): Boolean { - return (up.getDistributor(context) == context.packageName && - !FcmHelper.isPushSupported()) + return up.getDistributor(context) == context.packageName && !FcmHelper.isPushSupported() } fun getPrivacyFriendlyUpEndpoint(): String? {