Browse Source

use userId for webdav search

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 7 năm trước cách đây
mục cha
commit
a52b75eeed

+ 7 - 3
src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -1514,6 +1514,8 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
             new Handler(Looper.getMainLooper()).post(switchViewsRunnable);
             new Handler(Looper.getMainLooper()).post(switchViewsRunnable);
         }
         }
 
 
+        final Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext());
+
         final RemoteOperation remoteOperation;
         final RemoteOperation remoteOperation;
         if (!currentSearchType.equals(SearchType.SHARED_FILTER)) {
         if (!currentSearchType.equals(SearchType.SHARED_FILTER)) {
             boolean searchOnlyFolders = false;
             boolean searchOnlyFolders = false;
@@ -1521,13 +1523,15 @@ public class OCFileListFragment extends ExtendedListFragment implements OCFileLi
                 searchOnlyFolders = true;
                 searchOnlyFolders = true;
             }
             }
 
 
-            remoteOperation = new SearchOperation(event.getSearchQuery(), event.getSearchType(), searchOnlyFolders);
+            String userId = AccountManager.get(MainApp.getAppContext()).getUserData(currentAccount,
+                    com.owncloud.android.lib.common.accounts.AccountUtils.Constants.KEY_USER_ID);
+
+            remoteOperation = new SearchOperation(event.getSearchQuery(), event.getSearchType(), searchOnlyFolders,
+                    userId);
         } else {
         } else {
             remoteOperation = new GetRemoteSharesOperation();
             remoteOperation = new GetRemoteSharesOperation();
         }
         }
 
 
-        final Account currentAccount = AccountUtils.getCurrentOwnCloudAccount(MainApp.getAppContext());
-
         remoteOperationAsyncTask = new AsyncTask() {
         remoteOperationAsyncTask = new AsyncTask() {
             @Override
             @Override
             protected Object doInBackground(Object[] params) {
             protected Object doInBackground(Object[] params) {