Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
show outdated warning depending on subscription key
Signed-off-by: tobiasKaminsky <[email protected]>

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/94.json
#	app/src/main/java/com/nextcloud/client/database/entity/CapabilityEntity.kt
#	build.gradle
  • Loading branch information
tobiasKaminsky authored and alperozturk96 committed Nov 5, 2025
commit 1965ad192fe9dd1ea2ae1fb031948fba1b42b42b
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ class CapabilityUtilsIT : AbstractIT() {
assertTrue(test(OwnCloudVersion.nextcloud_20))
}

private fun test(version: OwnCloudVersion): Boolean =
CapabilityUtils.checkOutdatedWarning(targetContext.resources, version, false)
@Test
fun checkOutdatedWarningWithSubscription() {
assertFalse(test(NextcloudVersion.nextcloud_31))
assertFalse(test(NextcloudVersion.nextcloud_30))

assertFalse(test(OwnCloudVersion.nextcloud_20, true))
}

private fun test(version: OwnCloudVersion, hasValidSubscription: Boolean = false): Boolean =
CapabilityUtils.checkOutdatedWarning(targetContext.resources, version, false, hasValidSubscription)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2420,6 +2420,8 @@ private ContentValues createContentValues(String accountName, OCCapability capab
contentValues.put(ProviderTableMeta.CAPABILITIES_NOTES_FOLDER_PATH, capability.getNotesFolderPath());

contentValues.put(ProviderTableMeta.CAPABILITIES_DEFAULT_PERMISSIONS, capability.getDefaultPermissions());

contentValues.put(ProviderTableMeta.CAPABILITIES_HAS_VALID_SUBSCRIPTION, capability.getHasValidSubscription().getValue());

return contentValues;
}
Expand Down Expand Up @@ -2605,6 +2607,7 @@ private OCCapability createCapabilityInstance(Cursor cursor) {
capability.setNotesFolderPath(getString(cursor, ProviderTableMeta.CAPABILITIES_NOTES_FOLDER_PATH));

capability.setDefaultPermissions(getInt(cursor, ProviderTableMeta.CAPABILITIES_DEFAULT_PERMISSIONS));
capability.setHasValidSubscription(getBoolean(cursor, ProviderTableMeta.CAPABILITIES_HAS_VALID_SUBSCRIPTION));
}

return capability;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ static public class ProviderTableMeta implements BaseColumns {
public static final String CAPABILITIES_FILES_DOWNLOAD_LIMIT_DEFAULT = "files_download_limit_default";
public static final String CAPABILITIES_NOTES_FOLDER_PATH = "notes_folder_path";
public static final String CAPABILITIES_DEFAULT_PERMISSIONS = "default_permissions";
public static final String CAPABILITIES_HAS_VALID_SUBSCRIPTION = "has_valid_subscription";

//Columns of Uploads table
public static final String UPLOADS_LOCAL_PATH = "local_path";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ class FileDisplayActivity :
CapabilityUtils.checkOutdatedWarning(
getResources(),
user.get().server.version,
capabilities.extendedSupport.isTrue
capabilities.extendedSupport.isTrue,
capabilities.hasValidSubscription.isTrue
)
) {
DisplayUtils.showServerOutdatedSnackbar(this, Snackbar.LENGTH_LONG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,11 @@ public static boolean checkOutdatedWarning(Resources resources,
version.isOlderThan(MainApp.OUTDATED_SERVER_VERSION))
&& !hasExtendedSupport;
}

public static boolean checkOutdatedWarning(Resources resources,
OwnCloudVersion version,
boolean hasExtendedSupport,
boolean hasValidSubscription) {
return checkOutdatedWarning(resources, version, hasExtendedSupport) && !hasValidSubscription;
}
}
13 changes: 13 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18063,6 +18063,19 @@
<sha256 value="b29d8928cba81c13d016ac2e0b7a7d40f1b2e71f8229d65efcffb871a27576de" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="d525104338">
<artifact name="android-library-d525104338.aar">
<sha256 value="dbd608b7b39e8e89f82450f24a48fd0f084d264ea6b95b2993897e44de0954d3" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
<artifact name="android-library-d525104338.module">
<sha256 value="65bb7aa76e0d9992d5afcd15ea59bc996d8ed29ce79f177fc3f1910f4bc286dc" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="d525104338a94b61df6cf44041081d95ed2955c9">
<artifact name="android-library-d525104338a94b61df6cf44041081d95ed2955c9.pom">
<sha256 value="54aed157e9fbecdd01361b651f4f25163ffe6589d50c9506110f450e6faa9b01" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="d5f21fa1ec5b67c564983b0c8a07bc3acd96f695">
<artifact name="android-library-d5f21fa1ec5b67c564983b0c8a07bc3acd96f695.aar">
<sha256 value="95c86f501a4c1a2e055ba2d1fe68f5ffeed3613492bdaf0594abbae4b21b9227" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down