mirror of https://github.com/M66B/FairEmail.git
Fixed browsing messages
This commit is contained in:
parent
9dae0fe60c
commit
8f238c7e3f
|
@ -52,11 +52,8 @@ public interface DaoFolder {
|
||||||
@Query("SELECT folder.* FROM folder" +
|
@Query("SELECT folder.* FROM folder" +
|
||||||
" JOIN account ON account.id = folder.account" +
|
" JOIN account ON account.id = folder.account" +
|
||||||
" WHERE ((:folder IS NULL AND unified) OR (NOT :folder is NULL AND folder.id = :folder))" +
|
" WHERE ((:folder IS NULL AND unified) OR (NOT :folder is NULL AND folder.id = :folder))" +
|
||||||
" AND :search" +
|
" AND (:search OR (account.synchronize AND account.browse))")
|
||||||
" OR (folder.synchronize" +
|
List<EntityFolder> getBrowsableFolders(Long folder, boolean search);
|
||||||
" AND account.synchronize" +
|
|
||||||
" AND account.browse)")
|
|
||||||
List<EntityFolder> getFolders(Long folder, boolean search);
|
|
||||||
|
|
||||||
@Query("SELECT folder.*, account.name AS accountName, account.color AS accountColor, account.state AS accountState" +
|
@Query("SELECT folder.*, account.name AS accountName, account.color AS accountColor, account.state AS accountState" +
|
||||||
", COUNT(message.id) AS messages" +
|
", COUNT(message.id) AS messages" +
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class ViewModelBrowse extends ViewModel {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DB db = DB.getInstance(state.context);
|
DB db = DB.getInstance(state.context);
|
||||||
final List<EntityFolder> folders = db.folder().getFolders(
|
final List<EntityFolder> folders = db.folder().getBrowsableFolders(
|
||||||
state.fid < 0 ? null : state.fid, state.search != null);
|
state.fid < 0 ? null : state.fid, state.search != null);
|
||||||
Log.i("Search fid=" + (state.fid < 0 ? null : state.fid) + " search=" + (state.search == null) + " count=" + folders.size());
|
Log.i("Search fid=" + (state.fid < 0 ? null : state.fid) + " search=" + (state.search == null) + " count=" + folders.size());
|
||||||
if (folders.size() == 0)
|
if (folders.size() == 0)
|
||||||
|
|
Loading…
Reference in New Issue