mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-24 14:05:40 +03:00
make helper methods easy to access from java code
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
0fe26b6d08
commit
9fb176dc88
1 changed files with 4 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue