From 9fb176dc880cd60a9a81a77c9dcf33c60bc30553 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Tue, 5 Jul 2022 22:41:55 +0200 Subject: [PATCH] make helper methods easy to access from java code Signed-off-by: Andy Scherzinger --- .../nextcloud/talk/utils/database/user/CapabilitiesUtilNew.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/nextcloud/talk/utils/database/user/CapabilitiesUtilNew.kt b/app/src/main/java/com/nextcloud/talk/utils/database/user/CapabilitiesUtilNew.kt index 175753bb3..660ea9871 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/database/user/CapabilitiesUtilNew.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/database/user/CapabilitiesUtilNew.kt @@ -36,6 +36,7 @@ object CapabilitiesUtilNew { return false } + @JvmStatic fun isServerEOL(user: User): Boolean { // Capability is available since Talk 4 => Nextcloud 14 => Autmn 2018 return !hasSpreedFeatureCapability(user, "no-ping") @@ -50,6 +51,7 @@ object CapabilitiesUtilNew { return hasSpreedFeatureCapability(user, "chat-read-marker") } + @JvmStatic fun hasSpreedFeatureCapability(user: User, capabilityName: String): Boolean { if (user.capabilities?.spreedCapability?.features != null) { return user.capabilities!!.spreedCapability!!.features!!.contains(capabilityName) @@ -97,6 +99,7 @@ object CapabilitiesUtilNew { return false } + @JvmStatic fun isUserStatusAvailable(user: User): Boolean { return user.capabilities?.userStatusCapability?.enabled == true && user.capabilities?.userStatusCapability?.supportsEmoji == true @@ -146,6 +149,7 @@ object CapabilitiesUtilNew { return false } + @JvmStatic fun isUnifiedSearchAvailable(user: User): Boolean { return hasSpreedFeatureCapability(user, "unified-search") }