mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-19 05:38:31 +00:00
Fixed resetting folder types
This commit is contained in:
parent
ba116353d9
commit
7e2479d138
3 changed files with 5 additions and 9 deletions
|
@ -69,11 +69,6 @@ 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, account.color AS accountColor, account.state AS accountState" +
|
||||
", COUNT(message.id) AS messages" +
|
||||
", SUM(CASE WHEN message.content = 1 THEN 1 ELSE 0 END) AS content" +
|
||||
|
@ -170,6 +165,7 @@ public interface DaoFolder {
|
|||
@Query("UPDATE folder" +
|
||||
" SET type = '" + EntityFolder.USER + "'" +
|
||||
" WHERE account = :account" +
|
||||
" AND type <> '" + EntityFolder.INBOX + "'" +
|
||||
" AND type <> '" + EntityFolder.SYSTEM + "'")
|
||||
int setFoldersUser(long account);
|
||||
|
||||
|
|
|
@ -116,14 +116,14 @@ public class EntityFolder implements Serializable {
|
|||
"Flagged"
|
||||
);
|
||||
private static final List<String> SYSTEM_FOLDER_TYPE = Arrays.asList(
|
||||
ARCHIVE,
|
||||
ARCHIVE, // All
|
||||
ARCHIVE,
|
||||
DRAFTS,
|
||||
TRASH,
|
||||
JUNK,
|
||||
SENT,
|
||||
SYSTEM,
|
||||
SYSTEM
|
||||
SYSTEM, // Important
|
||||
SYSTEM // Flagged
|
||||
); // MUST match SYSTEM_FOLDER_ATTR
|
||||
|
||||
static final List<String> FOLDER_SORT_ORDER = Arrays.asList(
|
||||
|
|
|
@ -2218,7 +2218,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
folder.account = account.id;
|
||||
folder.name = fullName;
|
||||
folder.display = display;
|
||||
folder.type = EntityFolder.USER;
|
||||
folder.type = (EntityFolder.SYSTEM.equals(type) ? type : EntityFolder.USER);
|
||||
folder.level = level;
|
||||
folder.synchronize = false;
|
||||
folder.poll = ("imap.gmail.com".equals(account.host));
|
||||
|
|
Loading…
Reference in a new issue