Skip to content

Commit adeb988

Browse files
tobiasKaminskyAndyScherzinger
authored andcommitted
wip
Signed-off-by: tobiasKaminsky <[email protected]>
1 parent 3d4df5b commit adeb988

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import com.google.android.material.card.MaterialCardView
4848
import com.nextcloud.talk.R
4949
import com.nextcloud.talk.application.NextcloudTalkApplication
5050
import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication
51-
import com.nextcloud.talk.components.filebrowser.models.BrowserFile
5251
import com.nextcloud.talk.components.filebrowser.webdav.ReadFilesystemOperation
5352
import com.nextcloud.talk.data.user.model.User
5453
import com.nextcloud.talk.databinding.ReactionsInsideMessageBinding
@@ -61,6 +60,7 @@ import com.nextcloud.talk.utils.DisplayUtils
6160
import com.nextcloud.talk.utils.DrawableUtils.getDrawableResourceIdForMimeType
6261
import com.nextcloud.talk.utils.FileViewerUtils
6362
import com.nextcloud.talk.utils.FileViewerUtils.ProgressUi
63+
import com.owncloud.android.lib.resources.files.model.RemoteFile
6464
import com.stfalcon.chatkit.messages.MessageHolders.IncomingImageMessageViewHolder
6565
import io.reactivex.Single
6666
import io.reactivex.SingleObserver
@@ -318,7 +318,7 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
318318
override fun onSuccess(readFilesystemOperation: ReadFilesystemOperation) {
319319
val davResponse = readFilesystemOperation.readRemotePath()
320320
if (davResponse.data != null) {
321-
val browserFileList = davResponse.data as List<BrowserFile>
321+
val browserFileList = davResponse.data as List<RemoteFile>
322322
if (browserFileList.isNotEmpty()) {
323323
Handler(context!!.mainLooper).post {
324324
val resourceId = getDrawableResourceIdForMimeType(browserFileList[0].mimeType)

app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFilesystemOperation.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import android.net.Uri;
2424
import android.util.Log;
2525

26-
import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
2726
import com.nextcloud.talk.components.filebrowser.models.DavResponse;
2827
import com.nextcloud.talk.dagger.modules.RestModule;
2928
import com.nextcloud.talk.data.user.model.User;
@@ -73,8 +72,6 @@ public DavResponse readRemotePath() {
7372
DavResponse davResponse = new DavResponse();
7473
final List<Response> memberElements = new ArrayList<>();
7574
final Response[] rootElement = new Response[1];
76-
final List<BrowserFile> browserFiles = new ArrayList<>();
77-
final List<RemoteFile> remoteFiles = new ArrayList<>();
7875

7976
try {
8077
new DavResource(okHttpClient, HttpUrl.parse(url)).propfind(depth,
@@ -101,16 +98,12 @@ public void onResponse(@NonNull Response response, @NonNull Response.HrefRelatio
10198

10299
WebDavFileUtils webDavFileUtils = new WebDavFileUtils();
103100

104-
browserFiles.add(BrowserFile.Companion.getModelFromResponse(rootElement[0],
105-
rootElement[0].getHref().toString().substring(basePath.length())));
101+
final List<RemoteFile> remoteFiles = new ArrayList<>(1 + memberElements.size());
106102

107103
remoteFiles.add(webDavFileUtils.parseResponse(rootElement[0],
108104
Uri.parse(basePath)));
109105

110106
for (Response memberElement : memberElements) {
111-
browserFiles.add(BrowserFile.Companion.getModelFromResponse(memberElement,
112-
memberElement.getHref().toString().substring(basePath.length())));
113-
114107
remoteFiles.add(webDavFileUtils.parseResponse(memberElement,
115108
Uri.parse(basePath)));
116109
}

0 commit comments

Comments
 (0)