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

Commit ccc5223e authored by cketti's avatar cketti
Browse files

Use single queue for handling commands modifying messages

We want to use a single queue so commands are not sent to the server out of order.
parent 14c5c07e
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -1044,12 +1044,9 @@ public class MessagingController {

        setFlagInCache(account, messageIds, flag, newState);

        threadPool.execute(new Runnable() {
            @Override
            public void run() {
                setFlagSynchronous(account, messageIds, flag, newState, false);
            }
        });
        putBackground("setFlag", null, () ->
            setFlagSynchronous(account, messageIds, flag, newState, false)
        );
    }

    public void setFlagForThreads(final Account account, final List<Long> threadRootIds,
@@ -1057,12 +1054,9 @@ public class MessagingController {

        setFlagForThreadsInCache(account, threadRootIds, flag, newState);

        threadPool.execute(new Runnable() {
            @Override
            public void run() {
                setFlagSynchronous(account, threadRootIds, flag, newState, true);
            }
        });
        putBackground("setFlagForThreads", null, () ->
            setFlagSynchronous(account, threadRootIds, flag, newState, true)
        );
    }

    private void setFlagSynchronous(final Account account, final List<Long> ids,