mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-08 15:09:49 +00:00
move extension functions to methods
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
223bc6302c
commit
2a0ee1c90d
@ -55,22 +55,14 @@ data class UserNgEntity(
|
|||||||
fun hasSpreedFeatureCapability(capabilityName: String): Boolean {
|
fun hasSpreedFeatureCapability(capabilityName: String): Boolean {
|
||||||
return capabilities?.spreedCapability?.features?.contains(capabilityName) ?: false
|
return capabilities?.spreedCapability?.features?.contains(capabilityName) ?: false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fun UserNgEntity.canUserCreateGroupConversations(): Boolean {
|
fun canUserCreateGroupConversations(): Boolean {
|
||||||
val canCreateValue = capabilities?.spreedCapability?.config?.get("conversations")?.get("can-create")
|
val canCreateValue = capabilities?.spreedCapability?.config?.get("conversations")?.get("can-create")
|
||||||
canCreateValue?.let {
|
canCreateValue?.let {
|
||||||
return it.toBoolean()
|
return it.toBoolean()
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun UserNgEntity.toUser(): User {
|
fun getCredentials(): String = ApiUtils.getCredentials(username, token)
|
||||||
return User(
|
|
||||||
this.id, this.userId, this.username, this.baseUrl, this.token, this.displayName, this.pushConfigurationState,
|
|
||||||
this.capabilities, this.clientCertificate, this.externalSignalingServer, this.current,
|
|
||||||
this.scheduledForDeletion
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun UserNgEntity.getCredentials(): String = ApiUtils.getCredentials(username, token)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user