فهرست منبع

Migrate to new current user provider

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 2 سال پیش
والد
کامیت
1a20bd3a3b

+ 2 - 2
app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFolderListingOperation.kt

@@ -41,7 +41,7 @@ import com.nextcloud.talk.components.filebrowser.models.properties.OCFavorite
 import com.nextcloud.talk.components.filebrowser.models.properties.OCId
 import com.nextcloud.talk.components.filebrowser.models.properties.OCSize
 import com.nextcloud.talk.dagger.modules.RestModule.MagicAuthenticator
-import com.nextcloud.talk.models.database.UserEntity
+import com.nextcloud.talk.data.user.model.User
 import com.nextcloud.talk.remotefilebrowser.model.RemoteFileBrowserItem
 import com.nextcloud.talk.utils.ApiUtils
 import com.nextcloud.talk.utils.Mimetype.FOLDER
@@ -50,7 +50,7 @@ import okhttp3.OkHttpClient
 import java.io.File
 import java.io.IOException
 
-class ReadFolderListingOperation(okHttpClient: OkHttpClient, currentUser: UserEntity, path: String, depth: Int) {
+class ReadFolderListingOperation(okHttpClient: OkHttpClient, currentUser: User, path: String, depth: Int) {
     private val okHttpClient: OkHttpClient
     private val url: String
     private val depth: Int

+ 6 - 6
app/src/main/java/com/nextcloud/talk/remotefilebrowser/repositories/RemoteFileBrowserItemsRepositoryImpl.kt

@@ -21,20 +21,20 @@
 package com.nextcloud.talk.remotefilebrowser.repositories
 
 import com.nextcloud.talk.components.filebrowser.webdav.ReadFolderListingOperation
-import com.nextcloud.talk.models.database.UserEntity
+import com.nextcloud.talk.data.user.model.User
 import com.nextcloud.talk.remotefilebrowser.model.RemoteFileBrowserItem
-import com.nextcloud.talk.utils.database.user.CurrentUserProvider
+import com.nextcloud.talk.utils.database.user.CurrentUserProviderNew
 import io.reactivex.Observable
 import okhttp3.OkHttpClient
 import javax.inject.Inject
 
 class RemoteFileBrowserItemsRepositoryImpl @Inject constructor(
     private val okHttpClient: OkHttpClient,
-    private val userProvider: CurrentUserProvider
+    private val userProvider: CurrentUserProviderNew
 ) : RemoteFileBrowserItemsRepository {
 
-    private val userEntity: UserEntity
-        get() = userProvider.currentUser!!
+    private val user: User
+        get() = userProvider.currentUser.blockingGet()
 
     override fun listFolder(path: String):
         Observable<List<RemoteFileBrowserItem>> {
@@ -42,7 +42,7 @@ class RemoteFileBrowserItemsRepositoryImpl @Inject constructor(
             val operation =
                 ReadFolderListingOperation(
                     okHttpClient,
-                    userEntity,
+                    user,
                     path,
                     1
                 )