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:
alperozturk
2025-07-01 09:47:56 +02:00
committed by Alper Öztürk
parent 21beee4502
commit bb94fbce23

View File

@ -18,15 +18,16 @@ private const val PERMISSIONS_KEY = "permissions"
private const val VALUE_KEY = "value"
private const val ENABLED_KEY = "enabled"
fun OCShare?.toggleAllowDownloadAndSync(
fun toggleAllowDownloadAndSync(
attributes: String?,
isChecked: Boolean,
useV2DownloadAttributes: Boolean
): String? {
val jsonArray =
if (this?.attributes?.isEmpty() == true) {
if (attributes?.isEmpty() == true) {
JSONArray()
} else {
JSONArray(this?.attributes)
JSONArray(attributes)
}
val downloadAttr = jsonArray.findDownloadAttribute()
val enabledKey = getEnabledKey(useV2DownloadAttributes)