Allow swipe if target folders exists only

This commit is contained in:
M66B
2018-10-22 18:02:06 +00:00
parent 563df86870
commit feba289478
5 changed files with 39 additions and 13 deletions

View File

@@ -55,6 +55,11 @@ public interface DaoFolder {
" GROUP BY folder.id")
LiveData<List<TupleFolderEx>> liveFolders(long account);
@Query("SELECT * FROM folder" +
" WHERE (:account < 0 OR folder.account = :account)" +
" AND type <> '" + EntityFolder.USER + "'")
LiveData<List<EntityFolder>> liveSystemFolders(long account);
@Query("SELECT folder.*, account.name AS accountName" +
", COUNT(message.id) AS messages" +
", SUM(CASE WHEN message.content = 1 THEN 1 ELSE 0 END) AS content" +
@@ -118,9 +123,8 @@ public interface DaoFolder {
@Query("UPDATE folder" +
" SET type = '" + EntityFolder.USER + "'" +
" WHERE account = :account" +
" AND type = :type")
int setFolderUser(long account, String type);
" WHERE account = :account")
int setFoldersUser(long account);
@Query("UPDATE folder" +
" SET name = :name" +