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

Commit 1c922e81 authored by cketti's avatar cketti
Browse files

Merge branch '5.8-MAINT' into main

parents f6e9948c 5055669d
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ import com.fsck.k9.mail.MessageDownloadState;
import com.fsck.k9.mail.MessageRetrievalListener;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.Part;
import com.fsck.k9.mail.ServerSettings;
import com.fsck.k9.mailstore.LocalFolder;
import com.fsck.k9.mailstore.LocalMessage;
import com.fsck.k9.mailstore.LocalStore;
@@ -390,6 +391,12 @@ public class MessagingController {

    public void refreshFolderListSynchronous(Account account) {
        try {
            ServerSettings serverSettings = account.getIncomingServerSettings();
            if (serverSettings.password == null) {
                handleAuthenticationFailure(account, true);
                return;
            }

            Backend backend = getBackend(account);
            backend.refreshFolderList();

@@ -643,6 +650,12 @@ public class MessagingController {
    }

    private void syncFolder(Account account, long folderId, MessagingListener listener, Backend backend) {
        ServerSettings serverSettings = account.getIncomingServerSettings();
        if (serverSettings.password == null) {
            handleAuthenticationFailure(account, true);
            return;
        }

        Exception commandException = null;
        try {
            processPendingCommandsSynchronous(account);
@@ -1498,6 +1511,12 @@ public class MessagingController {
        Exception lastFailure = null;
        boolean wasPermanentFailure = false;
        try {
            ServerSettings serverSettings = account.getOutgoingServerSettings();
            if (serverSettings.password == null) {
                handleAuthenticationFailure(account, false);
                return;
            }

            LocalStore localStore = localStoreProvider.getInstance(account);
            OutboxStateRepository outboxStateRepository = localStore.getOutboxStateRepository();
            LocalFolder localFolder = localStore.getFolder(account.getOutboxFolderId());
+5 −0
Original line number Diff line number Diff line
@@ -39,6 +39,11 @@ class MailSyncWorker(
            return Result.success()
        }

        if (account.incomingServerSettings.password == null) {
            Timber.d("Password for this account is missing. Skipping mail sync.")
            return Result.success()
        }

        val success = messagingController.performPeriodicMailSync(account)

        return if (success) Result.success() else Result.retry()
+8 −0
Original line number Diff line number Diff line
@@ -14,11 +14,14 @@ import com.fsck.k9.K9RobolectricTest;
import com.fsck.k9.Preferences;
import com.fsck.k9.backend.BackendManager;
import com.fsck.k9.backend.api.Backend;
import com.fsck.k9.mail.AuthType;
import com.fsck.k9.mail.AuthenticationFailedException;
import com.fsck.k9.mail.CertificateValidationException;
import com.fsck.k9.mail.ConnectionSecurity;
import com.fsck.k9.mail.Flag;
import com.fsck.k9.mail.MessageRetrievalListener;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.ServerSettings;
import com.fsck.k9.mailstore.LocalFolder;
import com.fsck.k9.mailstore.LocalMessage;
import com.fsck.k9.mailstore.LocalStore;
@@ -31,6 +34,7 @@ import com.fsck.k9.mailstore.SendState;
import com.fsck.k9.mailstore.UnavailableStorageException;
import com.fsck.k9.notification.NotificationController;
import com.fsck.k9.notification.NotificationStrategy;
import com.fsck.k9.preferences.Protocols;
import com.fsck.k9.search.LocalSearch;
import com.fsck.k9.search.SearchAccount;
import org.jetbrains.annotations.NotNull;
@@ -441,6 +445,10 @@ public class MessagingControllerTest extends K9RobolectricTest {
        account = preferences.newAccount();
        accountUuid = account.getUuid();

        account.setIncomingServerSettings(new ServerSettings(Protocols.IMAP, "host", 993,
                ConnectionSecurity.SSL_TLS_REQUIRED, AuthType.PLAIN, "username", "password", null));
        account.setOutgoingServerSettings(new ServerSettings(Protocols.SMTP, "host", 465,
                ConnectionSecurity.SSL_TLS_REQUIRED, AuthType.PLAIN, "username", "password", null));
        account.setMaximumAutoDownloadMessageSize(MAXIMUM_SMALL_MESSAGE_SIZE);
        account.setEmail("user@host.com");
    }
+10 −0
Original line number Diff line number Diff line
@@ -134,6 +134,16 @@ open class MessageList :
    public override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // If the app's main task was not created using the default launch intent (e.g. from a notification, a widget,
        // or a shortcut), using the app icon to "launch" the app will create a new MessageList instance instead of only
        // bringing the app's task to the foreground. We catch this situation here and simply finish the activity. This
        // will bring the task to the foreground, showing the last active screen.
        if (intent.action == Intent.ACTION_MAIN && intent.hasCategory(Intent.CATEGORY_LAUNCHER) && !isTaskRoot) {
            Timber.v("Not displaying MessageList. Only bringing the app task to the foreground.")
            finish()
            return
        }

        val accounts = preferences.accounts
        deleteIncompleteAccounts(accounts)
        val hasAccountSetup = accounts.any { it.isFinishedSetup }
+7 −0
Original line number Diff line number Diff line
@@ -5,6 +5,13 @@
     Locale-specific versions are kept in res/raw-<locale qualifier>/changelog.xml.
-->
<changelog>
    <release version="5.804" versioncode="28004" date="2021-08-18">
        <change>Fixed a bug where Push didn't work with some servers</change>
        <change>Don't connect to the incoming or outgoing server when passwords haven't been provided after import</change>
        <change>Added missing scrollbars in screens showing the folder list</change>
        <change>Tapping the app icon should now always bring the app to the foreground instead of adding another message list screen</change>
        <change>Updated translations</change>
    </release>
    <release version="5.803" versioncode="28003" date="2021-08-12">
        <change>Don't show the icon for the ongoing Push notification in the status bar (on versions older than Android 8.0)</change>
        <change>Directly open system settings for notification categories (Android 8.0 and newer)</change>
Loading