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

Commit 724b6eaa authored by Jesse Vincent's avatar Jesse Vincent
Browse files

For a while, it was possible for users to conifgure their outbox and

drafts folders to be the same folder. This could result in drafts being
sent over and over.  This change uses the K-9 Identity header as a
shibboleth for drafts, as it's not actually set when a message is sent.
parent 659a5d36
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -3025,6 +3025,16 @@ public class MessagingController implements Runnable {


                    localFolder.fetch(new Message[] { message }, fp, null);
                    localFolder.fetch(new Message[] { message }, fp, null);
                    try {
                    try {


                        if (message.getHeader(K9.IDENTITY_HEADER) != null) {
                            Log.v(K9.LOG_TAG, "The user has set the Outbox and Drafts folder to the same thing. " +
                                  "This message appears to be a draft, so K-9 will not send it");
                            continue;

                        }


                        message.setFlag(Flag.X_SEND_IN_PROGRESS, true);
                        message.setFlag(Flag.X_SEND_IN_PROGRESS, true);
                        if (K9.DEBUG)
                        if (K9.DEBUG)
                            Log.i(K9.LOG_TAG, "Sending message with UID " + message.getUid());
                            Log.i(K9.LOG_TAG, "Sending message with UID " + message.getUid());