Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate OwncloudClient - Comments #12464

Merged
merged 5 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
package com.owncloud.android.operations;

import com.owncloud.android.lib.common.OwnCloudClient;
import com.nextcloud.common.NextcloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
Expand All @@ -16,7 +16,7 @@
/**
* Comment file
*/
public class CommentFileOperation extends RemoteOperation {
public class CommentFileOperation extends RemoteOperation<Void> {

private final String message;
private final long fileId;
Expand All @@ -37,8 +37,8 @@ public CommentFileOperation(String message, long fileId) {
* @param client Client object to communicate with the remote ownCloud server.
*/
@Override
protected RemoteOperationResult run(OwnCloudClient client) {
RemoteOperationResult result = new CommentFileRemoteOperation(message, fileId).execute(client);
public RemoteOperationResult<Void> run(NextcloudClient client) {
RemoteOperationResult<Void> result = new CommentFileRemoteOperation(message, fileId).execute(client);

if (!result.isSuccess()) {
Log_OC.e(this, "File with Id " + fileId + " could not be commented");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ public void submitComment() {

String trimmedComment = commentField.toString().trim();

if (trimmedComment.length() > 0 && ownCloudClient != null && isDataFetched) {
new SubmitCommentTask(trimmedComment, file.getLocalId(), callback, ownCloudClient).execute();
if (!trimmedComment.isEmpty() && nextcloudClient != null && isDataFetched) {
new SubmitCommentTask(trimmedComment, file.getLocalId(), callback, nextcloudClient).execute();
}
}

Expand Down Expand Up @@ -461,12 +461,12 @@ private static class SubmitCommentTask extends AsyncTask<Void, Void, Boolean> {
private final String message;
private final long fileId;
private final VersionListInterface.CommentCallback callback;
private final OwnCloudClient client;
private final NextcloudClient client;

private SubmitCommentTask(String message,
long fileId,
VersionListInterface.CommentCallback callback,
OwnCloudClient client) {
NextcloudClient client) {
this.message = message;
this.fileId = fileId;
this.callback = callback;
Expand All @@ -477,7 +477,7 @@ private SubmitCommentTask(String message,
protected Boolean doInBackground(Void... voids) {
CommentFileOperation commentFileOperation = new CommentFileOperation(message, fileId);

RemoteOperationResult result = commentFileOperation.execute(client);
RemoteOperationResult<Void> result = commentFileOperation.execute(client);

return result.isSuccess();
}
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
buildscript {
ext {
androidLibraryVersion = "354911a81da973d8874381480ed0ea577e992572"
androidLibraryVersion = "84711877b4703f8df3d638a016419b4aa731db2b"
androidPluginVersion = '8.4.0'
androidxMediaVersion = '1.3.1'
androidxTestVersion = "1.5.0"
Expand All @@ -23,7 +23,6 @@ buildscript {
jacoco_version = '0.8.12'
kotlin_version = '2.0.0'
markwonVersion = "4.6.2"
prismVersion = "2.0.0"
mockitoVersion = "4.11.0"
mockitoKotlinVersion = "4.1.0"
mockkVersion = "1.13.10"
Expand Down
11 changes: 11 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5792,6 +5792,17 @@
<artifact name="android-library-6dcffdb0ba.module">
<sha256 value="0e72841878595f83c6d8f93aa51f78a67e821f53446fcb7a5d94cfaad8ebbbac" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library"
version="84711877b4703f8df3d638a016419b4aa731db2b">
<artifact name="android-library-84711877b4703f8df3d638a016419b4aa731db2b.aar">
<sha256 value="d801b368fc7d4d5d2d2852765442ccbf7df21f0a9198d369181637a8142914cc"
origin="Generated by Gradle" reason="Artifact is not signed" />
</artifact>
<artifact name="android-library-84711877b4703f8df3d638a016419b4aa731db2b.module">
<sha256 value="de2e7d2fdde1d6981af8fcd54812dfe510ab7e22bdf8225ed569616b6c1155f4"
origin="Generated by Gradle" reason="Artifact is not signed" />
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="9fdcd0af0ff910086281f32e3b8ef74490671149">
<artifact name="android-library-9fdcd0af0ff910086281f32e3b8ef74490671149.aar">
Expand Down
Loading