mirror of
https://github.com/nextcloud/android-library.git
synced 2025-07-25 16:08:27 +00:00
toggleAllowDownloadAndSync must not be extension thus user can create a new share
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:

committed by
Alper Öztürk

parent
21beee4502
commit
bb94fbce23
@ -18,15 +18,16 @@ private const val PERMISSIONS_KEY = "permissions"
|
|||||||
private const val VALUE_KEY = "value"
|
private const val VALUE_KEY = "value"
|
||||||
private const val ENABLED_KEY = "enabled"
|
private const val ENABLED_KEY = "enabled"
|
||||||
|
|
||||||
fun OCShare?.toggleAllowDownloadAndSync(
|
fun toggleAllowDownloadAndSync(
|
||||||
|
attributes: String?,
|
||||||
isChecked: Boolean,
|
isChecked: Boolean,
|
||||||
useV2DownloadAttributes: Boolean
|
useV2DownloadAttributes: Boolean
|
||||||
): String? {
|
): String? {
|
||||||
val jsonArray =
|
val jsonArray =
|
||||||
if (this?.attributes?.isEmpty() == true) {
|
if (attributes?.isEmpty() == true) {
|
||||||
JSONArray()
|
JSONArray()
|
||||||
} else {
|
} else {
|
||||||
JSONArray(this?.attributes)
|
JSONArray(attributes)
|
||||||
}
|
}
|
||||||
val downloadAttr = jsonArray.findDownloadAttribute()
|
val downloadAttr = jsonArray.findDownloadAttribute()
|
||||||
val enabledKey = getEnabledKey(useV2DownloadAttributes)
|
val enabledKey = getEnabledKey(useV2DownloadAttributes)
|
||||||
|
Reference in New Issue
Block a user