Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f191178 authored by cketti's avatar cketti
Browse files

Fix `queue*()` methods

Change methods to only add a pending command, but not process the pending commands immediately.

Also, don't defer adding the pending command by using `putBackground()`. This can mess with the execution order of remote commands.
parent ccc5223e
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -952,11 +952,8 @@ public class MessagingController {
    }

    private void queueSetFlag(Account account, long folderId, boolean newState, Flag flag, List<String> uids) {
        putBackground("queueSetFlag", null, () -> {
        PendingCommand command = PendingSetFlag.create(folderId, newState, flag, uids);
        queuePendingCommand(account, command);
            processPendingCommands(account);
        });
    }

    /**
@@ -969,11 +966,8 @@ public class MessagingController {
    }

    private void queueDelete(Account account, long folderId, List<String> uids) {
        putBackground("queueDelete", null, () -> {
        PendingCommand command = PendingDelete.create(folderId, uids);
        queuePendingCommand(account, command);
            processPendingCommands(account);
        });
    }

    void processPendingDelete(PendingDelete command, Account account) throws MessagingException {