Merge pull request #12464 from nextcloud/depocc/comments

Deprecate OwncloudClient - Comments
This commit is contained in:
Tobias Kaminsky 2024-06-13 08:53:32 +02:00 committed by GitHub
commit 0a8277e1ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 11 deletions

View file

@ -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;
@ -16,7 +16,7 @@ import com.owncloud.android.lib.resources.comments.CommentFileRemoteOperation;
/**
* Comment file
*/
public class CommentFileOperation extends RemoteOperation {
public class CommentFileOperation extends RemoteOperation<Void> {
private final String message;
private final long fileId;
@ -37,8 +37,8 @@ public class CommentFileOperation extends RemoteOperation {
* @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");

View file

@ -183,8 +183,8 @@ public class FileDetailActivitiesFragment extends Fragment implements
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();
}
}
@ -461,12 +461,12 @@ public class FileDetailActivitiesFragment extends Fragment implements
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;
@ -477,7 +477,7 @@ public class FileDetailActivitiesFragment extends Fragment implements
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();
}

View file

@ -10,7 +10,7 @@
*/
buildscript {
ext {
androidLibraryVersion = "354911a81da973d8874381480ed0ea577e992572"
androidLibraryVersion = "84711877b4703f8df3d638a016419b4aa731db2b"
androidPluginVersion = '8.4.0'
androidxMediaVersion = '1.3.1'
androidxTestVersion = "1.5.0"
@ -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"

View file

@ -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">