From 35ac4b3726ba019955caa27ffc274c5232bcb37b Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 12 Jan 2022 15:04:25 +0100 Subject: [PATCH 01/68] Update translations --- app/ui/legacy/src/main/res/values-bg/strings.xml | 14 ++++++++++++-- app/ui/legacy/src/main/res/values-es/strings.xml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/ui/legacy/src/main/res/values-bg/strings.xml b/app/ui/legacy/src/main/res/values-bg/strings.xml index 71f7625001..cf7926cb44 100644 --- a/app/ui/legacy/src/main/res/values-bg/strings.xml +++ b/app/ui/legacy/src/main/res/values-bg/strings.xml @@ -73,6 +73,8 @@ K-9 Mail е мощен, безплатен имейл клиент за Андр Препрати като прикачен файл Изберете Профил Избери Папка + Премести в… + Копирай в… %d избрани Следващ Предишен @@ -97,6 +99,7 @@ K-9 Mail е мощен, безплатен имейл клиент за Андр Отхвърли Запази като чернова Провери пощата + Провери пощата от всички акаунти Изпрати съобщения Обнови списъка с папки Намери папка @@ -105,6 +108,7 @@ K-9 Mail е мощен, безплатен имейл клиент за Андр Търси Търси навсякъде Резултати от търсенето + Нови съобщения Настройки Управление на папки Настройки на профила @@ -159,6 +163,7 @@ K-9 Mail е мощен, безплатен имейл клиент за Андр Архивирайте Архивирай всички Спам + Грешка в сертификата Грешка в сертификата на %s Проверете настройките на сървара Неуспешна идентификация @@ -180,7 +185,7 @@ K-9 Mail е мощен, безплатен имейл клиент за Андр Кошче Изпратени Грешка при изпращане на някой съобщения - Version + Версия Включете доклада за дебъгване Записвайте допълнителна диагностична информация Записвайте поверителна информация @@ -443,6 +448,11 @@ K-9 Mail е мощен, безплатен имейл клиент за Андр Цветът в който ще мига LED на вашето у-во за този профил Размер на локалната папка Получавай съобщения до + 1 KiB + 2 KiB + 4 KiB + 8 KiB + 16 KiB без ограничение Синхронизиране на съобщенията от по всяко време @@ -979,7 +989,7 @@ K-9 Mail е мощен, безплатен имейл клиент за Андр Инициализира... Изчаква за нови съобщения Заспива докато синхронизирането на заден фон е разрешено - Заспива докато има мрежа + Спи докато чака за мрежа Натиснете за да научите повече. Push информация Когато използвате Push, K-9 Поща създава връзка до пощенския сървър. Андроид изисква показване на известие докато програмата е активна на заден фон. %s diff --git a/app/ui/legacy/src/main/res/values-es/strings.xml b/app/ui/legacy/src/main/res/values-es/strings.xml index 66ac59d842..ab3391f54a 100644 --- a/app/ui/legacy/src/main/res/values-es/strings.xml +++ b/app/ui/legacy/src/main/res/values-es/strings.xml @@ -21,7 +21,7 @@ No se pudo cargar el registro de cambios. Versión %s Novedades - Muestra cambios recientes cuando se actualiza la aplicación + Ver cambios recientes al actualizar la aplicación Descubre las novedades de esta versión Te damos la bienvenida a K-9 Mail -- GitLab From 0269cd5df7a92623fd7980a34be077366488d96f Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 12 Jan 2022 16:24:24 +0100 Subject: [PATCH 02/68] Version 5.909 --- app/k9mail/build.gradle | 4 ++-- app/ui/legacy/src/main/res/raw/changelog_master.xml | 7 +++++++ fastlane/metadata/android/en-US/changelogs/29009.txt | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/29009.txt diff --git a/app/k9mail/build.gradle b/app/k9mail/build.gradle index 7e19e808b6..ff6caaab7a 100644 --- a/app/k9mail/build.gradle +++ b/app/k9mail/build.gradle @@ -47,8 +47,8 @@ android { applicationId "com.fsck.k9" testApplicationId "com.fsck.k9.tests" - versionCode 29008 - versionName '5.909-SNAPSHOT' + versionCode 29009 + versionName '5.909' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", diff --git a/app/ui/legacy/src/main/res/raw/changelog_master.xml b/app/ui/legacy/src/main/res/raw/changelog_master.xml index ef4fd504fc..9b88dc2f48 100644 --- a/app/ui/legacy/src/main/res/raw/changelog_master.xml +++ b/app/ui/legacy/src/main/res/raw/changelog_master.xml @@ -5,6 +5,13 @@ Locale-specific versions are kept in res/raw-/changelog.xml. --> + + Only remove notifications for messages currently being displayed + Open message from notification in Unified Inbox if possible + Fixed stale message count for the Outbox folder + Fixed search field not working properly when using a hardware keyboard + Updated translations + Fixed a bug where sometimes the app created notifications when downloading old messages Fixed settings import so the imported theme is applied right away diff --git a/fastlane/metadata/android/en-US/changelogs/29009.txt b/fastlane/metadata/android/en-US/changelogs/29009.txt new file mode 100644 index 0000000000..dd7d27ebaa --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/29009.txt @@ -0,0 +1,5 @@ +- Only remove notifications for messages currently being displayed +- Open message from notification in Unified Inbox if possible +- Fixed stale message count for the Outbox folder +- Fixed search field not working properly when using a hardware keyboard +- Updated translations -- GitLab From 343ead3fdaae758eb225b4c14ce728d9bda1a56b Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 12 Jan 2022 16:33:30 +0100 Subject: [PATCH 03/68] Prepare for version 5.910 --- app/k9mail/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/k9mail/build.gradle b/app/k9mail/build.gradle index ff6caaab7a..39984fc03d 100644 --- a/app/k9mail/build.gradle +++ b/app/k9mail/build.gradle @@ -48,7 +48,7 @@ android { testApplicationId "com.fsck.k9.tests" versionCode 29009 - versionName '5.909' + versionName '5.910-SNAPSHOT' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", -- GitLab From 722e6b923fcdb511a72234cb4d06a92759059c9c Mon Sep 17 00:00:00 2001 From: parkerfath <51274393+parkerfath@users.noreply.github.com> Date: Fri, 14 Jan 2022 10:40:28 -0800 Subject: [PATCH 04/68] Change delimiter in address fields from ASCII 0 to 1 (#5863) Fixes search by sender name. Co-authored-by: Fath --- .../k9/storage/StoreSchemaDefinition.java | 2 +- .../k9/storage/migrations/MigrationTo84.kt | 60 +++++++++++++++++++ .../fsck/k9/storage/migrations/Migrations.kt | 1 + .../main/java/com/fsck/k9/mail/Address.java | 12 ++-- 4 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo84.kt diff --git a/app/storage/src/main/java/com/fsck/k9/storage/StoreSchemaDefinition.java b/app/storage/src/main/java/com/fsck/k9/storage/StoreSchemaDefinition.java index 0e75735da5..88764f4f91 100644 --- a/app/storage/src/main/java/com/fsck/k9/storage/StoreSchemaDefinition.java +++ b/app/storage/src/main/java/com/fsck/k9/storage/StoreSchemaDefinition.java @@ -12,7 +12,7 @@ import timber.log.Timber; class StoreSchemaDefinition implements SchemaDefinition { - static final int DB_VERSION = 83; + static final int DB_VERSION = 84; private final MigrationsHelper migrationsHelper; diff --git a/app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo84.kt b/app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo84.kt new file mode 100644 index 0000000000..01db3ebd80 --- /dev/null +++ b/app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo84.kt @@ -0,0 +1,60 @@ +package com.fsck.k9.storage.migrations + +import android.content.ContentValues +import android.database.sqlite.SQLiteDatabase +import androidx.core.database.getStringOrNull +import com.fsck.k9.helper.map + +/** + * Write the address fields to use ASCII 1 instead of ASCII 0 as separator. + * Separator was previously ASCII 0 but this caused problems with LIKE and searching. + */ +internal class MigrationTo84(private val db: SQLiteDatabase) { + + fun rewriteAddresses() { + val addressSets = db.rawQuery( + "SELECT id, to_list, cc_list, bcc_list, reply_to_list, sender_list FROM messages WHERE empty = 0 AND deleted = 0", + null + ).use { cursor -> + cursor.map { + + val messageId = it.getLong(0) + + messageId to AddressSet( + toList = it.getStringOrNull(1), + ccList = it.getStringOrNull(2), + bccList = it.getStringOrNull(3), + replyToList = it.getStringOrNull(4), + senderList = it.getStringOrNull(5) + ) + }.toMap() + } + + for ((messageId, addressSet) in addressSets) { + rewriteAddresses(messageId, addressSet) + } + } + + private fun rewriteAddress(inAddress: String?): String? { + return inAddress?.replace(oldChar = '\u0000', newChar = '\u0001') + } + + private fun rewriteAddresses(messageId: Long, addressSet: AddressSet) { + val cv = ContentValues().apply { + put("to_list", rewriteAddress(addressSet.toList)) + put("cc_list", rewriteAddress(addressSet.ccList)) + put("bcc_list", rewriteAddress(addressSet.bccList)) + put("reply_to_list", rewriteAddress(addressSet.replyToList)) + put("sender_list", rewriteAddress(addressSet.senderList)) + } + db.update("messages", cv, "id = ?", arrayOf(messageId.toString())) + } +} + +private data class AddressSet( + val toList: String?, + val ccList: String?, + val bccList: String?, + val replyToList: String?, + val senderList: String? +) diff --git a/app/storage/src/main/java/com/fsck/k9/storage/migrations/Migrations.kt b/app/storage/src/main/java/com/fsck/k9/storage/migrations/Migrations.kt index 51f373d30b..64c020e496 100644 --- a/app/storage/src/main/java/com/fsck/k9/storage/migrations/Migrations.kt +++ b/app/storage/src/main/java/com/fsck/k9/storage/migrations/Migrations.kt @@ -29,5 +29,6 @@ object Migrations { if (oldVersion < 81) MigrationTo81(db).addNotificationsTable() if (oldVersion < 82) MigrationTo82(db).addNewMessageColumn() if (oldVersion < 83) MigrationTo83(db, migrationsHelper).rewriteHighestKnownUid() + if (oldVersion < 84) MigrationTo84(db).rewriteAddresses() } } diff --git a/mail/common/src/main/java/com/fsck/k9/mail/Address.java b/mail/common/src/main/java/com/fsck/k9/mail/Address.java index 11861011f4..d90aa220a3 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/Address.java +++ b/mail/common/src/main/java/com/fsck/k9/mail/Address.java @@ -219,11 +219,11 @@ public class Address implements Serializable { int pairEndIndex = 0; int addressEndIndex = 0; while (pairStartIndex < length) { - pairEndIndex = addressList.indexOf(",\u0000", pairStartIndex); + pairEndIndex = addressList.indexOf(",\u0001", pairStartIndex); if (pairEndIndex == -1) { pairEndIndex = length; } - addressEndIndex = addressList.indexOf(";\u0000", pairStartIndex); + addressEndIndex = addressList.indexOf(";\u0001", pairStartIndex); String address = null; String personal = null; if (addressEndIndex == -1 || addressEndIndex > pairEndIndex) { @@ -241,8 +241,8 @@ public class Address implements Serializable { /** * Packs an address list into a String that is very quick to read * and parse. Packed lists can be unpacked with unpackAddressList() - * The packed list is a ",\u0000" separated list of: - * address;\u0000personal + * The packed list is a ",\u0001" separated list of: + * address;\u0001personal * @param addresses Array of addresses to pack. * @return Packed addresses. */ @@ -256,13 +256,13 @@ public class Address implements Serializable { sb.append(address.getAddress()); String personal = address.getPersonal(); if (personal != null) { - sb.append(";\u0000"); + sb.append(";\u0001"); // Escape quotes in the address part on the way in personal = personal.replaceAll("\"", "\\\""); sb.append(personal); } if (i < count - 1) { - sb.append(",\u0000"); + sb.append(",\u0001"); } } return sb.toString(); -- GitLab From 1efec7828f148b8f40aa768ccfd560714fe6e679 Mon Sep 17 00:00:00 2001 From: Bastian Wilhelm Date: Thu, 13 Jan 2022 19:55:24 +0100 Subject: [PATCH 05/68] Trim username by setup --- .../java/com/fsck/k9/activity/setup/AccountSetupIncoming.java | 4 ++-- .../java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java index b5cba2113a..8c4a41c4e7 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java @@ -550,7 +550,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener * Set the username and password for the outgoing settings to the username and * password the user just set for incoming. */ - String username = mUsernameView.getText().toString(); + String username = mUsernameView.getText().toString().trim(); String password = null; String clientCertificateAlias = null; @@ -579,7 +579,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener try { ConnectionSecurity connectionSecurity = getSelectedSecurity(); - String username = mUsernameView.getText().toString(); + String username = mUsernameView.getText().toString().trim(); String password = null; String clientCertificateAlias = null; diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java index 72eebcbedd..f73ab043c8 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java @@ -491,7 +491,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, clientCertificateAlias = mClientCertificateSpinner.getAlias(); } if (mRequireLoginView.isChecked()) { - username = mUsernameView.getText().toString(); + username = mUsernameView.getText().toString().trim(); authType = getSelectedAuthType(); if (AuthType.EXTERNAL != authType) { -- GitLab From 1ffc7ba02cfbba0b97c122433bc2d5b97c496bd2 Mon Sep 17 00:00:00 2001 From: Bastian Wilhelm Date: Thu, 13 Jan 2022 20:00:55 +0100 Subject: [PATCH 06/68] Remove warnings --- .../fsck/k9/activity/setup/AccountSetupIncoming.java | 10 +++------- .../fsck/k9/activity/setup/AccountSetupOutgoing.java | 12 ++++-------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java index 8c4a41c4e7..c3f27bcf59 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java @@ -21,6 +21,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.Spinner; import android.widget.Toast; +import androidx.annotation.NonNull; import com.fsck.k9.Account; import com.fsck.k9.DI; import com.fsck.k9.LocalKeyStoreManager; @@ -395,7 +396,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener } @Override - public void onSaveInstanceState(Bundle outState) { + public void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); outState.putString(EXTRA_ACCOUNT, mAccount.getUuid()); outState.putInt(STATE_SECURITY_TYPE_POSITION, mCurrentSecurityTypeViewPosition); @@ -662,12 +663,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener } }; - OnClientCertificateChangedListener clientCertificateChangedListener = new OnClientCertificateChangedListener() { - @Override - public void onClientCertificateChanged(String alias) { - validateFields(); - } - }; + OnClientCertificateChangedListener clientCertificateChangedListener = alias -> validateFields(); private AuthType getSelectedAuthType() { AuthTypeHolder holder = (AuthTypeHolder) mAuthTypeView.getSelectedItem(); diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java index f73ab043c8..8e64281ae7 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java @@ -22,6 +22,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.Spinner; import android.widget.Toast; +import androidx.annotation.NonNull; import com.fsck.k9.Account; import com.fsck.k9.DI; import com.fsck.k9.LocalKeyStoreManager; @@ -189,7 +190,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, } mSecurityTypeView.setSelection(mCurrentSecurityTypeViewPosition, false); - if (settings.username != null && !settings.username.isEmpty()) { + if (!settings.username.isEmpty()) { mUsernameView.setText(settings.username); mRequireLoginView.setChecked(true); mRequireLoginSettingsView.setVisibility(View.VISIBLE); @@ -316,7 +317,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, } @Override - public void onSaveInstanceState(Bundle outState) { + public void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); outState.putString(EXTRA_ACCOUNT, mAccount.getUuid()); outState.putInt(STATE_SECURITY_TYPE_POSITION, mCurrentSecurityTypeViewPosition); @@ -543,12 +544,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, } }; - OnClientCertificateChangedListener clientCertificateChangedListener = new OnClientCertificateChangedListener() { - @Override - public void onClientCertificateChanged(String alias) { - validateFields(); - } - }; + OnClientCertificateChangedListener clientCertificateChangedListener = alias -> validateFields(); private AuthType getSelectedAuthType() { AuthTypeHolder holder = (AuthTypeHolder) mAuthTypeView.getSelectedItem(); -- GitLab From e8a798c9de81f08d4917c38ad6b72438a4125a0f Mon Sep 17 00:00:00 2001 From: schlagi123 Date: Thu, 20 Jan 2022 00:10:05 +0100 Subject: [PATCH 07/68] Change default color for registered contacts (#5865) Change default value of `registeredNameColor` to have enough contrast in both the light and dark theme. --- app/core/src/main/java/com/fsck/k9/K9.kt | 4 +-- .../GeneralSettingsDescriptions.java | 26 ++++++++++++++++++- .../com/fsck/k9/preferences/Settings.java | 2 +- .../k9/preferences/K9StoragePersister.java | 2 +- .../migrations/StorageMigrationTo16.kt | 18 +++++++++++++ .../migrations/StorageMigrations.kt | 1 + .../src/main/res/xml/general_settings.xml | 3 ++- 7 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrationTo16.kt diff --git a/app/core/src/main/java/com/fsck/k9/K9.kt b/app/core/src/main/java/com/fsck/k9/K9.kt index 8e766e3a84..20826b4ffe 100644 --- a/app/core/src/main/java/com/fsck/k9/K9.kt +++ b/app/core/src/main/java/com/fsck/k9/K9.kt @@ -171,7 +171,7 @@ object K9 : EarlyInit { var isChangeContactNameColor = false @JvmStatic - var contactNameColor = 0xff00008f.toInt() + var contactNameColor = 0xFF1093F5.toInt() @JvmStatic var isShowContactPicture = true @@ -315,7 +315,7 @@ object K9 : EarlyInit { isShowContactName = storage.getBoolean("showContactName", false) isShowContactPicture = storage.getBoolean("showContactPicture", true) isChangeContactNameColor = storage.getBoolean("changeRegisteredNameColor", false) - contactNameColor = storage.getInt("registeredNameColor", -0xffff71) + contactNameColor = storage.getInt("registeredNameColor", 0xFF1093F5.toInt()) isUseMessageViewFixedWidthFont = storage.getBoolean("messageViewFixedWidthFont", false) isMessageViewReturnToList = storage.getBoolean("messageViewReturnToList", false) isMessageViewShowNext = storage.getBoolean("messageViewShowNext", false) diff --git a/app/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java b/app/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java index 7131e17416..34efb299a6 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java +++ b/app/core/src/main/java/com/fsck/k9/preferences/GeneralSettingsDescriptions.java @@ -10,6 +10,7 @@ import java.util.Set; import java.util.TreeMap; import android.content.Context; +import android.graphics.Color; import com.fsck.k9.Account; import com.fsck.k9.Account.SortType; @@ -157,7 +158,8 @@ public class GeneralSettingsDescriptions { new V(1, new TimeSetting("21:00")) )); s.put("registeredNameColor", Settings.versions( - new V(1, new ColorSetting(0xFF00008F)) + new V(1, new ColorSetting(0xFF00008F)), + new V(79, new ColorSetting(0xFF1093F5)) )); s.put("showContactName", Settings.versions( new V(1, new BooleanSetting(false)) @@ -284,6 +286,7 @@ public class GeneralSettingsDescriptions { u.put(31, new SettingsUpgraderV31()); u.put(58, new SettingsUpgraderV58()); u.put(69, new SettingsUpgraderV69()); + u.put(79, new SettingsUpgraderV79()); UPGRADERS = Collections.unmodifiableMap(u); } @@ -416,6 +419,27 @@ public class GeneralSettingsDescriptions { } } + /** + * Upgrades the settings from version 78 to 79. + * + *

+ * Change default value of {@code registeredNameColor} to have enough contrast in both the light and dark theme. + *

+ */ + private static class SettingsUpgraderV79 implements SettingsUpgrader { + + @Override + public Set upgrade(Map settings) { + final Integer registeredNameColorValue = (Integer) settings.get("registeredNameColor"); + + if (registeredNameColorValue != null && registeredNameColorValue == 0xFF00008F) { + settings.put("registeredNameColor", 0xFF1093F5); + } + + return null; + } + } + private static class LanguageSetting extends PseudoEnumSetting { private final Context context = DI.get(Context.class); private final Map mapping; diff --git a/app/core/src/main/java/com/fsck/k9/preferences/Settings.java b/app/core/src/main/java/com/fsck/k9/preferences/Settings.java index 6720583494..6fc05cae76 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/Settings.java +++ b/app/core/src/main/java/com/fsck/k9/preferences/Settings.java @@ -36,7 +36,7 @@ public class Settings { * * @see SettingsExporter */ - public static final int VERSION = 78; + public static final int VERSION = 79; static Map validate(int version, Map> settings, Map importedSettings, boolean useDefaultValues) { diff --git a/app/storage/src/main/java/com/fsck/k9/preferences/K9StoragePersister.java b/app/storage/src/main/java/com/fsck/k9/preferences/K9StoragePersister.java index ea138ca189..0087ed248a 100644 --- a/app/storage/src/main/java/com/fsck/k9/preferences/K9StoragePersister.java +++ b/app/storage/src/main/java/com/fsck/k9/preferences/K9StoragePersister.java @@ -21,7 +21,7 @@ import timber.log.Timber; public class K9StoragePersister implements StoragePersister { - private static final int DB_VERSION = 15; + private static final int DB_VERSION = 16; private static final String DB_NAME = "preferences_storage"; private final Context context; diff --git a/app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrationTo16.kt b/app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrationTo16.kt new file mode 100644 index 0000000000..c6418ba4bd --- /dev/null +++ b/app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrationTo16.kt @@ -0,0 +1,18 @@ +package com.fsck.k9.preferences.migrations + +import android.database.sqlite.SQLiteDatabase + +/** + * Change default value of `registeredNameColor` to have enough contrast in both the light and dark theme. + */ +class StorageMigrationTo16( + private val db: SQLiteDatabase, + private val migrationsHelper: StorageMigrationsHelper +) { + fun changeDefaultRegisteredNameColor() { + val registeredNameColorValue = migrationsHelper.readValue(db, "registeredNameColor")?.toInt() + if (registeredNameColorValue == 0xFF00008F.toInt()) { + migrationsHelper.writeValue(db, "registeredNameColor", 0xFF1093F5.toInt().toString()) + } + } +} diff --git a/app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrations.kt b/app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrations.kt index 8debf5f59a..807295aaf5 100644 --- a/app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrations.kt +++ b/app/storage/src/main/java/com/fsck/k9/preferences/migrations/StorageMigrations.kt @@ -21,5 +21,6 @@ internal object StorageMigrations { if (oldVersion < 13) StorageMigrationTo13(db, migrationsHelper).renameHideSpecialAccounts() if (oldVersion < 14) StorageMigrationTo14(db, migrationsHelper).disablePushFoldersForNonImapAccounts() if (oldVersion < 15) StorageMigrationTo15(db, migrationsHelper).rewriteIdleRefreshInterval() + if (oldVersion < 16) StorageMigrationTo16(db, migrationsHelper).changeDefaultRegisteredNameColor() } } diff --git a/app/ui/legacy/src/main/res/xml/general_settings.xml b/app/ui/legacy/src/main/res/xml/general_settings.xml index 13b9d614b5..bd29339b8c 100644 --- a/app/ui/legacy/src/main/res/xml/general_settings.xml +++ b/app/ui/legacy/src/main/res/xml/general_settings.xml @@ -292,7 +292,8 @@ + android:title="Contact name color" + android:defaultValue="#FF1093F5" /> Date: Wed, 19 Jan 2022 15:20:22 -0800 Subject: [PATCH 08/68] Allow remote search by default (#5867) --- app/core/src/main/java/com/fsck/k9/Account.java | 9 --------- .../main/java/com/fsck/k9/AccountPreferenceSerializer.kt | 4 ---- .../fsck/k9/preferences/AccountSettingsDescriptions.java | 3 --- .../java/com/fsck/k9/fragment/MessageListFragment.kt | 2 +- .../k9/ui/settings/account/AccountSettingsDataStore.kt | 2 -- .../k9/ui/settings/account/AccountSettingsFragment.kt | 2 -- app/ui/legacy/src/main/res/values-ar/strings.xml | 1 - app/ui/legacy/src/main/res/values-be/strings.xml | 2 -- app/ui/legacy/src/main/res/values-bg/strings.xml | 2 -- app/ui/legacy/src/main/res/values-br/strings.xml | 2 -- app/ui/legacy/src/main/res/values-ca/strings.xml | 2 -- app/ui/legacy/src/main/res/values-cs/strings.xml | 2 -- app/ui/legacy/src/main/res/values-cy/strings.xml | 2 -- app/ui/legacy/src/main/res/values-da/strings.xml | 2 -- app/ui/legacy/src/main/res/values-de/strings.xml | 2 -- app/ui/legacy/src/main/res/values-el/strings.xml | 2 -- app/ui/legacy/src/main/res/values-eo/strings.xml | 2 -- app/ui/legacy/src/main/res/values-es/strings.xml | 2 -- app/ui/legacy/src/main/res/values-et/strings.xml | 2 -- app/ui/legacy/src/main/res/values-eu/strings.xml | 2 -- app/ui/legacy/src/main/res/values-fa/strings.xml | 2 -- app/ui/legacy/src/main/res/values-fi/strings.xml | 2 -- app/ui/legacy/src/main/res/values-fr/strings.xml | 2 -- app/ui/legacy/src/main/res/values-gd/strings.xml | 2 -- app/ui/legacy/src/main/res/values-gl-rES/strings.xml | 2 -- app/ui/legacy/src/main/res/values-gl/strings.xml | 2 -- app/ui/legacy/src/main/res/values-hr/strings.xml | 2 -- app/ui/legacy/src/main/res/values-hu/strings.xml | 2 -- app/ui/legacy/src/main/res/values-in/strings.xml | 2 -- app/ui/legacy/src/main/res/values-is/strings.xml | 2 -- app/ui/legacy/src/main/res/values-it/strings.xml | 2 -- app/ui/legacy/src/main/res/values-ja/strings.xml | 2 -- app/ui/legacy/src/main/res/values-ko/strings.xml | 2 -- app/ui/legacy/src/main/res/values-lt/strings.xml | 2 -- app/ui/legacy/src/main/res/values-lv/strings.xml | 2 -- app/ui/legacy/src/main/res/values-ml/strings.xml | 2 -- app/ui/legacy/src/main/res/values-nb/strings.xml | 2 -- app/ui/legacy/src/main/res/values-nl/strings.xml | 2 -- app/ui/legacy/src/main/res/values-pl/strings.xml | 2 -- app/ui/legacy/src/main/res/values-pt-rBR/strings.xml | 2 -- app/ui/legacy/src/main/res/values-pt-rPT/strings.xml | 2 -- app/ui/legacy/src/main/res/values-ro/strings.xml | 2 -- app/ui/legacy/src/main/res/values-ru/strings.xml | 2 -- app/ui/legacy/src/main/res/values-sk/strings.xml | 2 -- app/ui/legacy/src/main/res/values-sl/strings.xml | 2 -- app/ui/legacy/src/main/res/values-sq/strings.xml | 2 -- app/ui/legacy/src/main/res/values-sr/strings.xml | 2 -- app/ui/legacy/src/main/res/values-sv/strings.xml | 2 -- app/ui/legacy/src/main/res/values-tr/strings.xml | 2 -- app/ui/legacy/src/main/res/values-uk/strings.xml | 2 -- app/ui/legacy/src/main/res/values-zh-rCN/strings.xml | 2 -- app/ui/legacy/src/main/res/values-zh-rTW/strings.xml | 2 -- app/ui/legacy/src/main/res/values/strings.xml | 2 -- app/ui/legacy/src/main/res/xml/account_settings.xml | 6 ------ 54 files changed, 1 insertion(+), 120 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/Account.java b/app/core/src/main/java/com/fsck/k9/Account.java index 5f1fdcdad6..9db0f904aa 100644 --- a/app/core/src/main/java/com/fsck/k9/Account.java +++ b/app/core/src/main/java/com/fsck/k9/Account.java @@ -173,7 +173,6 @@ public class Account implements BaseAccount { private boolean markMessageAsReadOnView; private boolean markMessageAsReadOnDelete; private boolean alwaysShowCcBcc; - private boolean allowRemoteSearch; private boolean remoteSearchFullText; private int remoteSearchNumResults; private boolean uploadSentMessages; @@ -980,14 +979,6 @@ public class Account implements BaseAccount { this.openPgpEncryptAllDrafts = openPgpEncryptAllDrafts; } - public boolean isAllowRemoteSearch() { - return allowRemoteSearch; - } - - public void setAllowRemoteSearch(boolean val) { - allowRemoteSearch = val; - } - public int getRemoteSearchNumResults() { return remoteSearchNumResults; } diff --git a/app/core/src/main/java/com/fsck/k9/AccountPreferenceSerializer.kt b/app/core/src/main/java/com/fsck/k9/AccountPreferenceSerializer.kt index 0eb58f801d..a2432855c5 100644 --- a/app/core/src/main/java/com/fsck/k9/AccountPreferenceSerializer.kt +++ b/app/core/src/main/java/com/fsck/k9/AccountPreferenceSerializer.kt @@ -167,7 +167,6 @@ class AccountPreferenceSerializer( isOpenPgpEncryptSubject = storage.getBoolean("$accountUuid.openPgpEncryptSubject", true) isOpenPgpEncryptAllDrafts = storage.getBoolean("$accountUuid.openPgpEncryptAllDrafts", true) autocryptPreferEncryptMutual = storage.getBoolean("$accountUuid.autocryptMutualMode", false) - isAllowRemoteSearch = storage.getBoolean("$accountUuid.allowRemoteSearch", false) isRemoteSearchFullText = storage.getBoolean("$accountUuid.remoteSearchFullText", false) remoteSearchNumResults = storage.getInt("$accountUuid.remoteSearchNumResults", DEFAULT_REMOTE_SEARCH_NUM_RESULTS) isUploadSentMessages = storage.getBoolean("$accountUuid.uploadSentMessages", true) @@ -321,7 +320,6 @@ class AccountPreferenceSerializer( editor.putBoolean("$accountUuid.openPgpEncryptAllDrafts", isOpenPgpEncryptAllDrafts) editor.putString("$accountUuid.openPgpProvider", openPgpProvider) editor.putBoolean("$accountUuid.autocryptMutualMode", autocryptPreferEncryptMutual) - editor.putBoolean("$accountUuid.allowRemoteSearch", isAllowRemoteSearch) editor.putBoolean("$accountUuid.remoteSearchFullText", isRemoteSearchFullText) editor.putInt("$accountUuid.remoteSearchNumResults", remoteSearchNumResults) editor.putBoolean("$accountUuid.uploadSentMessages", isUploadSentMessages) @@ -441,7 +439,6 @@ class AccountPreferenceSerializer( editor.remove("$accountUuid.markMessageAsReadOnView") editor.remove("$accountUuid.markMessageAsReadOnDelete") editor.remove("$accountUuid.alwaysShowCcBcc") - editor.remove("$accountUuid.allowRemoteSearch") editor.remove("$accountUuid.remoteSearchFullText") editor.remove("$accountUuid.remoteSearchNumResults") editor.remove("$accountUuid.uploadSentMessages") @@ -584,7 +581,6 @@ class AccountPreferenceSerializer( isStripSignature = DEFAULT_STRIP_SIGNATURE isSyncRemoteDeletions = true openPgpKey = NO_OPENPGP_KEY - isAllowRemoteSearch = false isRemoteSearchFullText = false remoteSearchNumResults = DEFAULT_REMOTE_SEARCH_NUM_RESULTS isUploadSentMessages = true diff --git a/app/core/src/main/java/com/fsck/k9/preferences/AccountSettingsDescriptions.java b/app/core/src/main/java/com/fsck/k9/preferences/AccountSettingsDescriptions.java index ba3310e755..ac5ffb210b 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/AccountSettingsDescriptions.java +++ b/app/core/src/main/java/com/fsck/k9/preferences/AccountSettingsDescriptions.java @@ -219,9 +219,6 @@ public class AccountSettingsDescriptions { s.put("vibrateTimes", Settings.versions( new V(1, new IntegerRangeSetting(1, 10, 5)) )); - s.put("allowRemoteSearch", Settings.versions( - new V(18, new BooleanSetting(true)) - )); s.put("remoteSearchNumResults", Settings.versions( new V(18, new IntegerResourceSetting(AccountPreferenceSerializer.DEFAULT_REMOTE_SEARCH_NUM_RESULTS, R.array.remote_search_num_results_values)) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt index ecc400c3e9..bd94e7b295 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/fragment/MessageListFragment.kt @@ -1436,7 +1436,7 @@ class MessageListFragment : } val isRemoteSearchAllowed: Boolean - get() = isManualSearch && !isRemoteSearch && isSingleFolderMode && account?.isAllowRemoteSearch == true + get() = isManualSearch && !isRemoteSearch && isSingleFolderMode && messagingController.isPushCapable(account) fun onSearchRequested(query: String): Boolean { val folderId = currentFolder?.databaseId diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt index 1dbbb44129..b011fe90ac 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsDataStore.kt @@ -36,7 +36,6 @@ class AccountSettingsDataStore( "openpgp_hide_sign_only" -> account.isOpenPgpHideSignOnly "openpgp_encrypt_subject" -> account.isOpenPgpEncryptSubject "openpgp_encrypt_all_drafts" -> account.isOpenPgpEncryptAllDrafts - "remote_search_enabled" -> account.isAllowRemoteSearch "autocrypt_prefer_encrypt" -> account.autocryptPreferEncryptMutual "upload_sent_messages" -> account.isUploadSentMessages "ignore_chat_messages" -> account.isIgnoreChatMessages @@ -60,7 +59,6 @@ class AccountSettingsDataStore( "account_vibrate" -> account.notificationSetting.isVibrateEnabled = value "account_led" -> account.notificationSetting.setLed(value) "account_notify_sync" -> account.isNotifySync = value - "remote_search_enabled" -> account.isAllowRemoteSearch = value "openpgp_hide_sign_only" -> account.isOpenPgpHideSignOnly = value "openpgp_encrypt_subject" -> account.isOpenPgpEncryptSubject = value "openpgp_encrypt_all_drafts" -> account.isOpenPgpEncryptAllDrafts = value diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt index 8c7de21753..d22a17431a 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt @@ -185,7 +185,6 @@ class AccountSettingsFragment : PreferenceFragmentCompat(), ConfirmationDialogFr if (!messagingController.isPushCapable(account)) { findPreference(PREFERENCE_PUSH_MODE)?.remove() findPreference(PREFERENCE_ADVANCED_PUSH_SETTINGS)?.remove() - findPreference(PREFERENCE_REMOTE_SEARCH)?.remove() } } @@ -429,7 +428,6 @@ class AccountSettingsFragment : PreferenceFragmentCompat(), ConfirmationDialogFr private const val PREFERENCE_MESSAGE_AGE = "account_message_age" private const val PREFERENCE_PUSH_MODE = "folder_push_mode" private const val PREFERENCE_ADVANCED_PUSH_SETTINGS = "push_advanced" - private const val PREFERENCE_REMOTE_SEARCH = "search" private const val PREFERENCE_OPENPGP_ENABLE = "openpgp_provider" private const val PREFERENCE_OPENPGP_KEY = "openpgp_key" private const val PREFERENCE_AUTOCRYPT_TRANSFER = "autocrypt_transfer" diff --git a/app/ui/legacy/src/main/res/values-ar/strings.xml b/app/ui/legacy/src/main/res/values-ar/strings.xml index f85ff65d86..6312169aa7 100644 --- a/app/ui/legacy/src/main/res/values-ar/strings.xml +++ b/app/ui/legacy/src/main/res/values-ar/strings.xml @@ -684,7 +684,6 @@ 1000 إرسال الطلب إلى الخادوم ابحث - تمكين البحث في الخادوم ابحث عن الرسائل في الخادم تغيير لون الرسالة بعد قراءتها إجمع الرسائل في محادثات diff --git a/app/ui/legacy/src/main/res/values-be/strings.xml b/app/ui/legacy/src/main/res/values-be/strings.xml index 52a0806362..27263e5bc6 100644 --- a/app/ui/legacy/src/main/res/values-be/strings.xml +++ b/app/ui/legacy/src/main/res/values-be/strings.xml @@ -811,8 +811,6 @@ K-9 Mail - шматфункцыянальны свабодны паштовы к Не атрымалася выканаць адлеглы пошук Пошук - Уключыць пошук на серверы - Шукаць лісты на серверы і прыладзе Пошук лістоў на серверы Для пошуку на серверы патрабуецца злучэнне з сеткай. Змяняць колер падчас чытання diff --git a/app/ui/legacy/src/main/res/values-bg/strings.xml b/app/ui/legacy/src/main/res/values-bg/strings.xml index cf7926cb44..dd12cafcb6 100644 --- a/app/ui/legacy/src/main/res/values-bg/strings.xml +++ b/app/ui/legacy/src/main/res/values-bg/strings.xml @@ -799,8 +799,6 @@ K-9 Mail е мощен, безплатен имейл клиент за Андр Търсенето на сървърва е неуспешно Търсене - Разреши търсене на сървъра - Търсене на съобщения на сървъра, в допълнение към тези, на вашето устройство Търсене на съобщения в сървъра Нужна е връзка с мрежата, за да бъде извършено търсене в сървъра. Промяна на цвета след прочитане diff --git a/app/ui/legacy/src/main/res/values-br/strings.xml b/app/ui/legacy/src/main/res/values-br/strings.xml index 657b8b56ce..59e07674d5 100644 --- a/app/ui/legacy/src/main/res/values-br/strings.xml +++ b/app/ui/legacy/src/main/res/values-br/strings.xml @@ -754,8 +754,6 @@ Danevellit beugoù, kenlabourit war keweriusterioù nevez ha savit goulennoù wa C’hwitadenn war ar c’hlask Klask - Gweredekaat klask war an dafariad - Klask kemennadennoù war an dafariad ouzhpenn d’ar re war ho trevnad Klask kemennadennoù war an dafariad Ret eo deoc’h bezañ kennasket evit klask war an dafariad Kemmañ al liv p’eo lennet diff --git a/app/ui/legacy/src/main/res/values-ca/strings.xml b/app/ui/legacy/src/main/res/values-ca/strings.xml index cbb554d117..4d9a567a36 100644 --- a/app/ui/legacy/src/main/res/values-ca/strings.xml +++ b/app/ui/legacy/src/main/res/values-ca/strings.xml @@ -830,8 +830,6 @@ Si us plau, envieu informes d\'errors, contribuïu-hi amb noves millores i feu p No s\'ha pogut fer la cerca remota. Cerca - Activa la cerca del servidor - Es cerquen els missatges al vostre dispositiu així com al servidor. Cerca missatges al servidor No es pot fer la cerca sense connectivitat a la xarxa. Canvia el color quan s\'hagi llegit diff --git a/app/ui/legacy/src/main/res/values-cs/strings.xml b/app/ui/legacy/src/main/res/values-cs/strings.xml index 0826ad0869..e57bfc5a47 100644 --- a/app/ui/legacy/src/main/res/values-cs/strings.xml +++ b/app/ui/legacy/src/main/res/values-cs/strings.xml @@ -838,8 +838,6 @@ Hlášení o chyb, úpravy pro nové funkce a dotazy zadávejte prostřednictví Vzdálené vyhledávání se nezdařilo Hledání - Povolit vyhledávání na serveru - Hledat zprávy na serveru navíc k těm v zařízení Hledat zprávy na serveru Vzdálené vyhledávání není k dispozici bez připojení k síti. Ztmavit zprávy po přečtení diff --git a/app/ui/legacy/src/main/res/values-cy/strings.xml b/app/ui/legacy/src/main/res/values-cy/strings.xml index 14fb64873c..77d61ec13c 100644 --- a/app/ui/legacy/src/main/res/values-cy/strings.xml +++ b/app/ui/legacy/src/main/res/values-cy/strings.xml @@ -806,8 +806,6 @@ Plîs rho wybod am unrhyw wallau, syniadau am nodweddion newydd, neu ofyn cwesti Methodd y chwilio o bell Chwilio - Galluogi chwilio\'r gweinydd - Chwilio negeseuon ar y gweinydd yn ogystal â\'r rhai ar dy ddyfais. Chwilio negeseuon ar y gweinydd Rhaid bod cysylltiad rhyngrwyd er mwyn chwilio\'r gweinydd. Newid lliw ar ôl darllen diff --git a/app/ui/legacy/src/main/res/values-da/strings.xml b/app/ui/legacy/src/main/res/values-da/strings.xml index 7b6540c9ae..97a2620c3a 100644 --- a/app/ui/legacy/src/main/res/values-da/strings.xml +++ b/app/ui/legacy/src/main/res/values-da/strings.xml @@ -806,8 +806,6 @@ Rapporter venligst fejl, forslag til nye funktioner eller stil spørgsmål på: Fjernsøgning fejlede Søg - Aktiver søgning på server - Søg meddelelser på både enhed og server Søg i meddelelser på server En netværksforbindelse er nødvendig når der søges på server. Skift farve når læst diff --git a/app/ui/legacy/src/main/res/values-de/strings.xml b/app/ui/legacy/src/main/res/values-de/strings.xml index 69869a515c..aae1893bf4 100644 --- a/app/ui/legacy/src/main/res/values-de/strings.xml +++ b/app/ui/legacy/src/main/res/values-de/strings.xml @@ -830,8 +830,6 @@ Bitte senden Sie Fehlerberichte, Ideen für neue Funktionen und stellen Sie Frag Suche fehlgeschlagen Suche - Serverseitige Suche - Nachrichten nicht nur auf dem Gerät, sondern auch auf dem Server suchen Nachrichten auf Server suchen Für die Suche auf dem Server ist eine Netzverbindung nötig. Farbe ändern, wenn gelesen diff --git a/app/ui/legacy/src/main/res/values-el/strings.xml b/app/ui/legacy/src/main/res/values-el/strings.xml index 8bb5be7134..90eb8552a8 100644 --- a/app/ui/legacy/src/main/res/values-el/strings.xml +++ b/app/ui/legacy/src/main/res/values-el/strings.xml @@ -817,8 +817,6 @@ Η απομακρυσμένη αναζήτηση απέτυχε. Αναζήτηση - Ενεργοποίηση αναζήτησης στον εξυπηρετητή - Αναζήτηση μηνυμάτων στον εξυπηρετητή, πέραν εκείνων που βρίσκονται στη συσκευή σας Αναζήτηση μηνυμάτων στον εξυπηρετητή Η απομακρυσμένη αναζήτηση δεν είναι διαθέσιμη χωρίς σύνδεση δικτύου. Αλλαγή χρώματος μετά την ανάγνωση diff --git a/app/ui/legacy/src/main/res/values-eo/strings.xml b/app/ui/legacy/src/main/res/values-eo/strings.xml index ff1c08d3e0..d6c1ecd231 100644 --- a/app/ui/legacy/src/main/res/values-eo/strings.xml +++ b/app/ui/legacy/src/main/res/values-eo/strings.xml @@ -817,8 +817,6 @@ Bonvolu raporti erarojn, kontribui novajn eblojn kaj peti pri novaj funkcioj per Fora serĉo fiaskis Serĉi - Aktivigi serĉado en servilo - Serĉi mesaĝojn en la servilo kaj en via aparato Serĉi mesaĝojn en servilo Interreta konekto estas bezonata por serĉi en servilo. Ŝanĝi koloron se legita diff --git a/app/ui/legacy/src/main/res/values-es/strings.xml b/app/ui/legacy/src/main/res/values-es/strings.xml index ab3391f54a..e0f789bfe1 100644 --- a/app/ui/legacy/src/main/res/values-es/strings.xml +++ b/app/ui/legacy/src/main/res/values-es/strings.xml @@ -828,8 +828,6 @@ Puedes informar de fallos, contribuir con su desarrollo y hacer preguntas en Ha fallado la búsqueda remota Buscar - Habilitar búsqueda en servidor - Buscar mensajes en servidor y en dispositivo Buscar mensajes en servidor No se puede buscar en remoto sin conexión de red. Cambiar el color al leer diff --git a/app/ui/legacy/src/main/res/values-et/strings.xml b/app/ui/legacy/src/main/res/values-et/strings.xml index 284747d2bd..b996592ae0 100644 --- a/app/ui/legacy/src/main/res/values-et/strings.xml +++ b/app/ui/legacy/src/main/res/values-et/strings.xml @@ -833,8 +833,6 @@ Veateated saad saata, kaastööd teha ning küsida teavet järgmisel lehel: Kaugotsing ebaõnnestus Otsi - Luba serverist otsimine - Lisaks seadmes olevatele kirjadele otsi ka serveris asuvate kirjade seast Otsi serveris olevate kirjade seast Serverist otsimiseks on vajalik võrguühendus. Muuda lugemisel värvi diff --git a/app/ui/legacy/src/main/res/values-eu/strings.xml b/app/ui/legacy/src/main/res/values-eu/strings.xml index 2beb2d275f..fa48d64bd0 100644 --- a/app/ui/legacy/src/main/res/values-eu/strings.xml +++ b/app/ui/legacy/src/main/res/values-eu/strings.xml @@ -804,8 +804,6 @@ Mesedez akatsen berri emateko, ezaugarri berriak gehitzeko eta galderak egiteko Urruneko bilaketak huts egin du Bilatu - Gaitu zerbitzarian bilatzea - Bilatu mezuak zerbitzarian zure gailuan dauden horiez gain Bilatu mezuak zerbitzarian Zerbitzarian bilatzeko sareko konexioa behar da. Aldatu kolorea irakurritakoan diff --git a/app/ui/legacy/src/main/res/values-fa/strings.xml b/app/ui/legacy/src/main/res/values-fa/strings.xml index db52979f40..58e49eb4a9 100644 --- a/app/ui/legacy/src/main/res/values-fa/strings.xml +++ b/app/ui/legacy/src/main/res/values-fa/strings.xml @@ -819,8 +819,6 @@ جستجو از دور ناموفق بود جستجو - فعال‌سازی جستجو در کارساز - هنگام جستجو علاوه بر پیام‌های روی دستگاه، پیام‌های روی کارساز را هم می‌گردد جستجوی پیام‌ها در کارساز برای جستجو در کارساز به اتصال شبکه نیاز دارید. تغییر رنگ پس از خواندن diff --git a/app/ui/legacy/src/main/res/values-fi/strings.xml b/app/ui/legacy/src/main/res/values-fi/strings.xml index 280647a66c..cf48fc19a0 100644 --- a/app/ui/legacy/src/main/res/values-fi/strings.xml +++ b/app/ui/legacy/src/main/res/values-fi/strings.xml @@ -829,8 +829,6 @@ Ilmoita virheistä, ota osaa sovelluskehitykseen ja esitä kysymyksiä osoittees Etähaku epäonnistui Hae - Ota etähaku käyttöön - Etsi viestejä palvelimelta laitteessasi olevien lisäksi Etsi viestejä palvelimelta Etähaku ei ole käytettävissä ilman verkkoyhteyttä. Vaihda väriä kun luettu diff --git a/app/ui/legacy/src/main/res/values-fr/strings.xml b/app/ui/legacy/src/main/res/values-fr/strings.xml index 9c26a509d3..9198e584d8 100644 --- a/app/ui/legacy/src/main/res/values-fr/strings.xml +++ b/app/ui/legacy/src/main/res/values-fr/strings.xml @@ -831,8 +831,6 @@ Rapportez les bogues, recommandez de nouvelles fonctions et posez vos questions Échec de recherche distante Rechercher - Activer la recherche sur le serveur - Rechercher des courriels sur le serveur en plus de ceux sur votre appareil Rechercher des courriels sur le serveur Une connexion réseau est nécessaire pour la recherche sur le serveur. Changer la couleur quand le courriel est lu diff --git a/app/ui/legacy/src/main/res/values-gd/strings.xml b/app/ui/legacy/src/main/res/values-gd/strings.xml index 76db007771..2405e8e75a 100644 --- a/app/ui/legacy/src/main/res/values-gd/strings.xml +++ b/app/ui/legacy/src/main/res/values-gd/strings.xml @@ -769,8 +769,6 @@ Dh’fhàillig an lorg cèin Lorg - Cuir an comas lorg air an fhrithealaiche - Lorg teachdaireachdan air an fhrithealaiche a bharrachd air an fheadhainn air an uidheam agad Lorg teachdaireachdan air an fhrithealaiche Feumaidh tu ceangal ris an lìonra mus urrainn dhut lorg a dhèanamh air an fhrithealaiche. Atharraich an dath nuair a chaidh a leughadh diff --git a/app/ui/legacy/src/main/res/values-gl-rES/strings.xml b/app/ui/legacy/src/main/res/values-gl-rES/strings.xml index 63d9849964..41c0e08771 100644 --- a/app/ui/legacy/src/main/res/values-gl-rES/strings.xml +++ b/app/ui/legacy/src/main/res/values-gl-rES/strings.xml @@ -615,8 +615,6 @@ Enviando consulta ao servidor Erro na procura en remoto Procurar - Habilitar procuras no servidor - Procurar mensaxes no servidor ademais de no teu dispositivo Procurar mensaxes no servidor Requírese unha conexión á rede para procurar no servidor. Vistar en conversación diff --git a/app/ui/legacy/src/main/res/values-gl/strings.xml b/app/ui/legacy/src/main/res/values-gl/strings.xml index b943ddee5e..491c4dd7e0 100644 --- a/app/ui/legacy/src/main/res/values-gl/strings.xml +++ b/app/ui/legacy/src/main/res/values-gl/strings.xml @@ -823,8 +823,6 @@ Por favor envíen informes de fallos, contribúa con novas características e co Fallou a busca remota Procurar - Habilitar a busca en servidor - Buscar mensaxes no servidor ademáis de no seu dispositivo Buscar mensaxes no servidor Precísase conexión a rede para buscar no servidor. Cambiar a cor cando lido diff --git a/app/ui/legacy/src/main/res/values-hr/strings.xml b/app/ui/legacy/src/main/res/values-hr/strings.xml index b100dd5d3d..9c0d7289b9 100644 --- a/app/ui/legacy/src/main/res/values-hr/strings.xml +++ b/app/ui/legacy/src/main/res/values-hr/strings.xml @@ -760,8 +760,6 @@ Udaljeno pretraživanje nije uspjelo Pretraga - Omogući pretraživanje poslužitelja - Pretraži poruke na poslužitelju a potom one na vašem uređaju Pretraži poruke na poslužitelju Potrebna je mrežna veza za pretragu poslužitelja. Promijeni boju kada je pročitano diff --git a/app/ui/legacy/src/main/res/values-hu/strings.xml b/app/ui/legacy/src/main/res/values-hu/strings.xml index 3c1bcc3f37..a4a49bd00c 100644 --- a/app/ui/legacy/src/main/res/values-hu/strings.xml +++ b/app/ui/legacy/src/main/res/values-hu/strings.xml @@ -817,8 +817,6 @@ Hibajelentések beküldésével közreműködhet az új funkciókban, és kérd A távoli keresés sikertelen Keresés - Kiszolgálón keresés engedélyezése - Üzenetek keresése a kiszolgálón az eszközön lévők mellett Üzenetek keresése a kiszolgálón Hálózati kapcsolat szükséges a kiszolgálón kereséshez. Szín megváltoztatása olvasáskor diff --git a/app/ui/legacy/src/main/res/values-in/strings.xml b/app/ui/legacy/src/main/res/values-in/strings.xml index 456f86b92e..72198adcad 100644 --- a/app/ui/legacy/src/main/res/values-in/strings.xml +++ b/app/ui/legacy/src/main/res/values-in/strings.xml @@ -790,8 +790,6 @@ Kirimkan laporan bug, kontribusikan fitur baru dan ajukan pertanyaan di Penelusuran jarak jauh gagal Cari - Aktifkan pencarian server - Cari pesan di server selain yang ada di perangkat Anda Cari pesan di server Sambungan jaringan diperlukan untuk pencarian server. Ubah warna saat dibaca diff --git a/app/ui/legacy/src/main/res/values-is/strings.xml b/app/ui/legacy/src/main/res/values-is/strings.xml index 72d49aaffb..1693b7e711 100644 --- a/app/ui/legacy/src/main/res/values-is/strings.xml +++ b/app/ui/legacy/src/main/res/values-is/strings.xml @@ -818,8 +818,6 @@ Sendu inn villuskýrslur, leggðu fram nýja eiginleika og spurðu spurninga á Fjartengd leit mistókst Leita - Virkja leit á póstþjóni - Leita að skilaboðum á póstþjóninum auk þeirra sem eru á tækinu þínu Leita að skilaboðum á póstþjóni Nettenging er nauðsynleg til að geta leitað á póstþjóni. Breyta lit þegar búið er að lesa diff --git a/app/ui/legacy/src/main/res/values-it/strings.xml b/app/ui/legacy/src/main/res/values-it/strings.xml index f812c27efb..7c94bf6433 100644 --- a/app/ui/legacy/src/main/res/values-it/strings.xml +++ b/app/ui/legacy/src/main/res/values-it/strings.xml @@ -820,8 +820,6 @@ Invia segnalazioni di bug, contribuisci con nuove funzionalità e poni domande s Ricerca remota non riuscita Cerca - Abilita la ricerca sul server - Cerca messaggi sul server oltre a quelli sul dispositivo Cerca messaggi sul server Le ricerche sul server richiedono una connessione alla rete. Cambia colore dopo la lettura diff --git a/app/ui/legacy/src/main/res/values-ja/strings.xml b/app/ui/legacy/src/main/res/values-ja/strings.xml index 3c50b731ee..bcea086eec 100644 --- a/app/ui/legacy/src/main/res/values-ja/strings.xml +++ b/app/ui/legacy/src/main/res/values-ja/strings.xml @@ -816,8 +816,6 @@ K-9 は大多数のメールクライアントと同様に、ほとんどのフ サーバ検索失敗 検索 - サーバでの検索を有効にする - デバイス内での検索に加え、サーバでメッセージを検索する サーバでメッセージを検索する サーバでの検索にはネットワーク接続が必要 既読の色を変更 diff --git a/app/ui/legacy/src/main/res/values-ko/strings.xml b/app/ui/legacy/src/main/res/values-ko/strings.xml index c38a9c3404..86d7d9d6b4 100644 --- a/app/ui/legacy/src/main/res/values-ko/strings.xml +++ b/app/ui/legacy/src/main/res/values-ko/strings.xml @@ -657,8 +657,6 @@ 원격 검색 실패 검색 - 서버 검색 사용 - 장치에 있는 메일과 서버에 있는 메일을 모두 검색합니다 서버에서 메시지 검색 네트워크 연결이 없어 서버 검색을 할 수 없습니다. 대화형 보기 diff --git a/app/ui/legacy/src/main/res/values-lt/strings.xml b/app/ui/legacy/src/main/res/values-lt/strings.xml index 66b8f4064e..69f6527e04 100644 --- a/app/ui/legacy/src/main/res/values-lt/strings.xml +++ b/app/ui/legacy/src/main/res/values-lt/strings.xml @@ -587,8 +587,6 @@ Užklausiamas serveris Nuotolinė paieška nepavyko Ieškoti - Įgalinti paiešką serveryje - Ieškoti laiškų ir serveryje, ne vien įrenginyje Ieškoti laiškų serveryje Paieškai serveryje reikia interneto ryšio. Teminis rodinys diff --git a/app/ui/legacy/src/main/res/values-lv/strings.xml b/app/ui/legacy/src/main/res/values-lv/strings.xml index edb85c364d..652202d8bc 100644 --- a/app/ui/legacy/src/main/res/values-lv/strings.xml +++ b/app/ui/legacy/src/main/res/values-lv/strings.xml @@ -829,8 +829,6 @@ pat %d vairāk Attālinātā meklēšana neizdevās Meklēt - Iestatīt meklēšanu serverī - Meklēt vēstules gan serverī, gan ierīcē Meklēt vēstules serverī Nepieciešams tīkla savienojums, lai meklētu serverī. Nomainīt krāsu pēc izlasīšanas diff --git a/app/ui/legacy/src/main/res/values-ml/strings.xml b/app/ui/legacy/src/main/res/values-ml/strings.xml index f33f557e4b..8bfed7ffa1 100644 --- a/app/ui/legacy/src/main/res/values-ml/strings.xml +++ b/app/ui/legacy/src/main/res/values-ml/strings.xml @@ -796,8 +796,6 @@ വിദൂര തിരയൽ പരാജയപ്പെട്ടു തിരയുക - സെർവർ തിരയൽ പ്രാപ്തമാക്കുക - നിങ്ങളുടെ ഉപകരണത്തിലുള്ളവയ്‌ക്ക് പുറമേ സെർവറിൽ സന്ദേശങ്ങൾ തിരയുക സെർവറിൽ സന്ദേശങ്ങൾ തിരയുക സെർവർ തിരയലിനായി ഒരു നെറ്റ്‌വർക്ക് കണക്ഷൻ ആവശ്യമാണ്. വായിക്കുമ്പോൾ നിറം മാറ്റുക diff --git a/app/ui/legacy/src/main/res/values-nb/strings.xml b/app/ui/legacy/src/main/res/values-nb/strings.xml index 77aa12d54c..e5f3263145 100644 --- a/app/ui/legacy/src/main/res/values-nb/strings.xml +++ b/app/ui/legacy/src/main/res/values-nb/strings.xml @@ -782,8 +782,6 @@ til %d flere Eksternt søk mislyktes Søk - Aktiver søk på tjener - Søk etter meldinger på tjeneren i tillegg til de på enheten din Søk etter meldinger på tjener En nettverksforbindelse er nødvendig for søk på tjener. Endre farge når lest diff --git a/app/ui/legacy/src/main/res/values-nl/strings.xml b/app/ui/legacy/src/main/res/values-nl/strings.xml index 2d370062b0..7bae8e8ccc 100644 --- a/app/ui/legacy/src/main/res/values-nl/strings.xml +++ b/app/ui/legacy/src/main/res/values-nl/strings.xml @@ -818,8 +818,6 @@ Graag foutrapporten sturen, bijdragen voor nieuwe functies en vragen stellen op Zoekopdracht mislukt Zoeken - Server zoeken toestaan - Zoek berichten op de server en op je eigen toestel Zoek berichten op server Er is een netwerk verbinding nodig voor server zoeken. Kleur wijzigen na lezen diff --git a/app/ui/legacy/src/main/res/values-pl/strings.xml b/app/ui/legacy/src/main/res/values-pl/strings.xml index 7093fb90bb..9572f95eed 100644 --- a/app/ui/legacy/src/main/res/values-pl/strings.xml +++ b/app/ui/legacy/src/main/res/values-pl/strings.xml @@ -843,8 +843,6 @@ Wysłane z urządzenia Android za pomocą K-9 Mail. Proszę wybaczyć moją zwi Wyszukiwanie na serwerze nie powiodło się Wyszukiwanie - Włącz wyszukiwanie na serwerze - Szukaj wiadomości na serwerze oraz tych na urządzeniu Wyszukuj wiadomości na serwerze Połączenie sieciowe jest wymagane aby korzystać z wyszukiwania na serwerze. Zmień kolor przeczytanych diff --git a/app/ui/legacy/src/main/res/values-pt-rBR/strings.xml b/app/ui/legacy/src/main/res/values-pt-rBR/strings.xml index 4c699ef74e..9a4547c864 100644 --- a/app/ui/legacy/src/main/res/values-pt-rBR/strings.xml +++ b/app/ui/legacy/src/main/res/values-pt-rBR/strings.xml @@ -829,8 +829,6 @@ Por favor encaminhe relatórios de bugs, contribua com novos recursos e tire dú Não foi possível efetuar a pesquisa remota Pesquisar - Habilitar pesquisa no servidor - Pesquisa mensagens também no servidor, além do seu dispositivo Pesquisar mensagens no servidor É necessária uma conexão de rede para pesquisar no servidor. Alterar a cor após a leitura diff --git a/app/ui/legacy/src/main/res/values-pt-rPT/strings.xml b/app/ui/legacy/src/main/res/values-pt-rPT/strings.xml index 75046dff6b..efc41c3a87 100644 --- a/app/ui/legacy/src/main/res/values-pt-rPT/strings.xml +++ b/app/ui/legacy/src/main/res/values-pt-rPT/strings.xml @@ -787,8 +787,6 @@ Por favor envie relatórios de falhas, contribua com novas funcionalidades e col A pesquisa remota falhou Pesquisa - Ativar pesquisa no servidor - Pesquisar mensagens no servidor em adição às que se encontram no seu dispositivo Pesquisar mensagens no servidor É necessária uma ligação à rede para pesquisar no servidor. Mudar de cor quando lido diff --git a/app/ui/legacy/src/main/res/values-ro/strings.xml b/app/ui/legacy/src/main/res/values-ro/strings.xml index 176c7ad841..7e736ad618 100644 --- a/app/ui/legacy/src/main/res/values-ro/strings.xml +++ b/app/ui/legacy/src/main/res/values-ro/strings.xml @@ -839,8 +839,6 @@ Uneori datorită faptului că cineva încearcă să te atace pe tine sau serveru Căutare la distanță eșuată Căutare - Activează căutarea pe server - Caută în mesajele de pe server în plus față de cele de pe dispozitiv Caută în mesajele de pe server Este necesară conexiunea la rețea pentru căutarea pe server. Schimbă culoarea după citire diff --git a/app/ui/legacy/src/main/res/values-ru/strings.xml b/app/ui/legacy/src/main/res/values-ru/strings.xml index 3296585de9..c29948f7bd 100644 --- a/app/ui/legacy/src/main/res/values-ru/strings.xml +++ b/app/ui/legacy/src/main/res/values-ru/strings.xml @@ -836,8 +836,6 @@ K-9 Mail — почтовый клиент для Android. Сбой поиска на сервере Поиск - Поиск на сервере - Искать сообщения локально и на сервере Поиск на сервере Для поиска на сервере необходимо подключение к сети Менять цвет при прочтении diff --git a/app/ui/legacy/src/main/res/values-sk/strings.xml b/app/ui/legacy/src/main/res/values-sk/strings.xml index 0f1d5cb2e3..bc232046a7 100644 --- a/app/ui/legacy/src/main/res/values-sk/strings.xml +++ b/app/ui/legacy/src/main/res/values-sk/strings.xml @@ -794,8 +794,6 @@ Prosím, nahlasujte prípadné chyby, prispievajte novými funkciami a pýtajte Odoslanie dotazu na server Vzdialené vyhľadávanie sa nepodarilo Vyhľadávanie - Povoliť vyhľadávanie na serveri - Hľadať správy na serveri, okrem tých na vašom zariadení Vyhľadávať správy na serveri Pripojenie k sieti je nevyhnutné pre vzdialené vyhľadávanie. Zmeniť farbu po prečítaní diff --git a/app/ui/legacy/src/main/res/values-sl/strings.xml b/app/ui/legacy/src/main/res/values-sl/strings.xml index 3cd2cb32d9..fdbf2f85c3 100644 --- a/app/ui/legacy/src/main/res/values-sl/strings.xml +++ b/app/ui/legacy/src/main/res/values-sl/strings.xml @@ -844,8 +844,6 @@ dodatnih %d sporočil Oddaljeno iskanje je spodletelo Iskanje - Omogoči iskanje na strežniku - Preišči krajevna in tudi neusklajena sporočila na strežniku Poišči sporočila na strežniku Za iskanje na strežniku je zahtevana dejavna omrežna povezava. Spremeni barvo prebranega sporočila diff --git a/app/ui/legacy/src/main/res/values-sq/strings.xml b/app/ui/legacy/src/main/res/values-sq/strings.xml index 90ac944682..b993c73c57 100644 --- a/app/ui/legacy/src/main/res/values-sq/strings.xml +++ b/app/ui/legacy/src/main/res/values-sq/strings.xml @@ -831,8 +831,6 @@ Ju lutemi, parashtrim njoftimesh për të meta, kontribute për veçori të reaj Kërkimi në largësi dështoi Kërko - Aktivizo kërkime në shërbyes - Kërkoni te mesazhet në shërbyes, përtej atyre te pajisja juaj Kërko mesazhe në shërbyes Për kërkime në shërbyes lypset lidhje në rrjet. Ndryshoji ngjyrën kur lexohet diff --git a/app/ui/legacy/src/main/res/values-sr/strings.xml b/app/ui/legacy/src/main/res/values-sr/strings.xml index e27c901721..b3a7c50da1 100644 --- a/app/ui/legacy/src/main/res/values-sr/strings.xml +++ b/app/ui/legacy/src/main/res/values-sr/strings.xml @@ -804,8 +804,6 @@ Претрага сервера није успела Претрага - Укључи и сервер у претрагу - Претраживаће и поруке на серверу уз оне на вашем уређају Тражи поруке на серверу За претрагу сервера потребна је мрежна веза. Промени боју након читања diff --git a/app/ui/legacy/src/main/res/values-sv/strings.xml b/app/ui/legacy/src/main/res/values-sv/strings.xml index b960a9f239..c2e6a9fa34 100644 --- a/app/ui/legacy/src/main/res/values-sv/strings.xml +++ b/app/ui/legacy/src/main/res/values-sv/strings.xml @@ -830,8 +830,6 @@ Skicka gärna in felrapporter, bidra med nya funktioner och ställ frågor på Fjärrsökning misslyckades Sök - Aktivera serversökning - Sök även meddelanden på servern utöver de som finns på din enhet Sök meddelanden på servern Nätverksanslutning krävs för att söka på servern. Byt färg efter läst diff --git a/app/ui/legacy/src/main/res/values-tr/strings.xml b/app/ui/legacy/src/main/res/values-tr/strings.xml index 95c02aa398..a6d4c580c8 100644 --- a/app/ui/legacy/src/main/res/values-tr/strings.xml +++ b/app/ui/legacy/src/main/res/values-tr/strings.xml @@ -814,8 +814,6 @@ Microsoft Exchange ile konuşurken bazı tuhaflıklar yaşadığını not ediniz Başarısız uzaktan arama Ara - Sunucu aramasını etkinleştir - Cihazınıza ek olarak sunucu üzerinde mesaj ara Sunucuda mesaj ara Sunucuda arama için ağ bağlantısı gereklidir. Okunduğunda rengi değiştir diff --git a/app/ui/legacy/src/main/res/values-uk/strings.xml b/app/ui/legacy/src/main/res/values-uk/strings.xml index 424131b89d..15408dd4e3 100644 --- a/app/ui/legacy/src/main/res/values-uk/strings.xml +++ b/app/ui/legacy/src/main/res/values-uk/strings.xml @@ -824,8 +824,6 @@ K-9 Mail — це вільний клієнт електронної пошти Віддалений пошук не вдався Пошук - Увімкнути пошук на сервері - Шукати повідомлення на сервері на додаток до тих, що є на вашому пристрої Шукати повідомлення на сервері Для пошуку на сервері необхідне з\'єднання з мережею. Змінювати колір при прочитанні diff --git a/app/ui/legacy/src/main/res/values-zh-rCN/strings.xml b/app/ui/legacy/src/main/res/values-zh-rCN/strings.xml index 497a6b2129..370e6eaceb 100644 --- a/app/ui/legacy/src/main/res/values-zh-rCN/strings.xml +++ b/app/ui/legacy/src/main/res/values-zh-rCN/strings.xml @@ -823,8 +823,6 @@ K-9 Mail 是 Android 上一款功能强大的免费邮件客户端。 远程搜索失败 搜索 - 启用服务器搜索 - 除了您的设备之外也在服务器上进行搜索 在服务器上搜索 服务器搜索需要网络连接。 阅读时改变颜色 diff --git a/app/ui/legacy/src/main/res/values-zh-rTW/strings.xml b/app/ui/legacy/src/main/res/values-zh-rTW/strings.xml index fb5307d42f..78bda5b188 100644 --- a/app/ui/legacy/src/main/res/values-zh-rTW/strings.xml +++ b/app/ui/legacy/src/main/res/values-zh-rTW/strings.xml @@ -812,8 +812,6 @@ K-9 Mail 是 Android 上一款功能強大,免費的電子郵件用戶端。 遠端搜尋失敗 搜尋 - 啟用伺服器搜尋 - 除了搜尋您的裝置外,同時搜尋伺服器上的訊息 搜尋伺服器上的訊息內容 沒有網路連線,無法進行遠端搜尋。 讀取時變更顏色 diff --git a/app/ui/legacy/src/main/res/values/strings.xml b/app/ui/legacy/src/main/res/values/strings.xml index 9d1375ce1c..8a5b6d6c37 100644 --- a/app/ui/legacy/src/main/res/values/strings.xml +++ b/app/ui/legacy/src/main/res/values/strings.xml @@ -1003,8 +1003,6 @@ Please submit bug reports, contribute new features and ask questions at Remote search failed Search - Enable server search - Search messages on the server in addition to those on your device Search messages on server A network connection is required for server search. diff --git a/app/ui/legacy/src/main/res/xml/account_settings.xml b/app/ui/legacy/src/main/res/xml/account_settings.xml index a23606ee5a..689b1e2cf0 100644 --- a/app/ui/legacy/src/main/res/xml/account_settings.xml +++ b/app/ui/legacy/src/main/res/xml/account_settings.xml @@ -391,13 +391,7 @@ android:key="search" android:title="@string/account_settings_search"> - - Date: Thu, 20 Jan 2022 00:28:01 +0100 Subject: [PATCH 09/68] Remove JMAP app The JMAP backend is still part of the repository. Only currently unused. --- app/k9mail-jmap/build.gradle | 135 -------- app/k9mail-jmap/proguard-rules.pro | 52 --- app/k9mail-jmap/src/main/AndroidManifest.xml | 300 ------------------ .../src/main/java/com/fsck/k9/App.kt | 35 -- .../src/main/java/com/fsck/k9/Dependencies.kt | 31 -- .../com/fsck/k9/MessagingListenerProvider.kt | 5 - .../fsck/k9/backends/AndroidAlarmManager.kt | 72 ----- .../fsck/k9/backends/ImapBackendFactory.kt | 90 ------ .../fsck/k9/backends/JmapAccountCreator.kt | 62 ---- .../fsck/k9/backends/JmapBackendFactory.kt | 28 -- .../java/com/fsck/k9/backends/KoinModule.kt | 39 --- .../fsck/k9/backends/OkHttpClientProvider.kt | 16 - .../fsck/k9/backends/Pop3BackendFactory.kt | 35 -- .../fsck/k9/backends/WebDavBackendFactory.kt | 35 -- .../com/fsck/k9/glide/K9AppGlideModule.java | 8 - .../K9NotificationActionCreator.kt | 234 -------------- .../K9NotificationResourceProvider.kt | 100 ------ .../k9/notification/K9NotificationStrategy.kt | 69 ---- .../com/fsck/k9/notification/KoinModule.kt | 9 - .../k9/resources/K9AutocryptStringProvider.kt | 10 - .../k9/resources/K9CoreResourceProvider.kt | 52 --- .../java/com/fsck/k9/resources/KoinModule.kt | 10 - .../com/fsck/k9/ui/DataBindingAdapters.kt | 21 -- .../k9/ui/addaccount/AddAccountActivity.kt | 31 -- .../k9/ui/addaccount/AddAccountFragment.kt | 39 --- .../k9/ui/addaccount/AddAccountViewModel.kt | 157 --------- .../com/fsck/k9/ui/addaccount/KoinModule.kt | 8 - .../main/res/layout/activity_add_account.xml | 20 -- .../main/res/layout/fragment_add_account.xml | 117 ------- .../res/navigation/navigation_add_account.xml | 25 -- .../res/navigation/navigation_onboarding.xml | 45 --- .../src/main/res/values/strings.xml | 11 - .../com/fsck/k9/DependencyInjectionTest.kt | 47 --- .../org.mockito.plugins.MockMaker | 1 - settings.gradle | 1 - 35 files changed, 1950 deletions(-) delete mode 100644 app/k9mail-jmap/build.gradle delete mode 100644 app/k9mail-jmap/proguard-rules.pro delete mode 100644 app/k9mail-jmap/src/main/AndroidManifest.xml delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/App.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/Dependencies.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/MessagingListenerProvider.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/backends/AndroidAlarmManager.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/backends/JmapAccountCreator.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/backends/JmapBackendFactory.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/backends/KoinModule.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/backends/OkHttpClientProvider.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/backends/Pop3BackendFactory.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/glide/K9AppGlideModule.java delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationResourceProvider.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/notification/KoinModule.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/resources/K9AutocryptStringProvider.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/resources/K9CoreResourceProvider.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/resources/KoinModule.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/ui/DataBindingAdapters.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountActivity.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountFragment.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountViewModel.kt delete mode 100644 app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/KoinModule.kt delete mode 100644 app/k9mail-jmap/src/main/res/layout/activity_add_account.xml delete mode 100644 app/k9mail-jmap/src/main/res/layout/fragment_add_account.xml delete mode 100644 app/k9mail-jmap/src/main/res/navigation/navigation_add_account.xml delete mode 100644 app/k9mail-jmap/src/main/res/navigation/navigation_onboarding.xml delete mode 100644 app/k9mail-jmap/src/main/res/values/strings.xml delete mode 100644 app/k9mail-jmap/src/test/java/com/fsck/k9/DependencyInjectionTest.kt delete mode 100644 app/k9mail-jmap/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker diff --git a/app/k9mail-jmap/build.gradle b/app/k9mail-jmap/build.gradle deleted file mode 100644 index d29aea28ab..0000000000 --- a/app/k9mail-jmap/build.gradle +++ /dev/null @@ -1,135 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'org.jetbrains.kotlin.android' -apply plugin: 'kotlin-kapt' - -if (rootProject.testCoverage) { - apply plugin: 'jacoco' -} - -dependencies { - implementation project(":app:ui:legacy") - implementation project(":app:core") - implementation project(":app:storage") - implementation project(":app:crypto-openpgp") - implementation project(":backend:imap") - implementation project(":backend:pop3") - implementation project(":backend:webdav") - implementation project(":backend:jmap") - - implementation "androidx.appcompat:appcompat:${versions.androidxAppCompat}" - implementation "com.jakewharton.timber:timber:${versions.timber}" - implementation "androidx.constraintlayout:constraintlayout:${versions.androidxConstraintLayout}" - implementation "com.google.android.material:material:${versions.materialComponents}" - implementation "androidx.navigation:navigation-fragment-ktx:${versions.androidxNavigation}" - implementation "androidx.navigation:navigation-ui-ktx:${versions.androidxNavigation}" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.androidxLifecycle}" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:${versions.androidxLifecycle}" - - implementation "com.github.bumptech.glide:glide:${versions.glide}" - kapt "com.github.bumptech.glide:compiler:${versions.glide}" - - // Required for DependencyInjectionTest to be able to resolve OpenPgpApiManager - testImplementation project(':plugins:openpgp-api-lib:openpgp-api') - - testImplementation "org.robolectric:robolectric:${versions.robolectric}" - testImplementation "junit:junit:${versions.junit}" - testImplementation "com.google.truth:truth:${versions.truth}" - testImplementation "org.mockito:mockito-core:${versions.mockito}" - testImplementation "org.mockito.kotlin:mockito-kotlin:${versions.mockitoKotlin}" - testImplementation "io.insert-koin:koin-test-junit4:${versions.koin}" -} - -android { - compileSdkVersion buildConfig.compileSdk - buildToolsVersion buildConfig.buildTools - - defaultConfig { - applicationId "com.fsck.k9.jmap" - testApplicationId "com.fsck.k9.jmap.tests" - - versionCode 1 - versionName 'JMAP DEV' - - minSdkVersion buildConfig.minSdk - targetSdkVersion buildConfig.targetSdk - - generatedDensities = ['mdpi', 'hdpi', 'xhdpi'] - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - signingConfigs { - release - } - - buildTypes { - release { - if (project.hasProperty('storeFile')) { - signingConfig signingConfigs.release - } - - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - - buildConfigField "boolean", "DEVELOPER_MODE", "false" - } - - debug { - applicationIdSuffix ".debug" - testCoverageEnabled rootProject.testCoverage - - minifyEnabled false - - buildConfigField "boolean", "DEVELOPER_MODE", "true" - } - } - - // Do not abort build if lint finds errors - lintOptions { - abortOnError false - lintConfig file("$rootProject.projectDir/config/lint/lint.xml") - } - - packagingOptions { - exclude 'META-INF/DEPENDENCIES' - exclude 'META-INF/LICENSE' - exclude 'META-INF/LICENSE.txt' - exclude 'META-INF/NOTICE' - exclude 'META-INF/NOTICE.txt' - exclude 'META-INF/README' - exclude 'LICENSE.txt' - exclude 'META-INF/*.kotlin_module' - } - - compileOptions { - sourceCompatibility javaVersion - targetCompatibility javaVersion - } - - kotlinOptions { - jvmTarget = kotlinJvmVersion - } - - buildFeatures { - dataBinding = true - } - - testOptions { - unitTests { - includeAndroidResources = true - } - } -} - -if (project.hasProperty('keyAlias')) { - android.signingConfigs.release.keyAlias = keyAlias -} -if (project.hasProperty('keyPassword')) { - android.signingConfigs.release.keyPassword = keyPassword -} -if (project.hasProperty('storeFile')) { - android.signingConfigs.release.storeFile = file(storeFile) -} -if (project.hasProperty('storePassword')) { - android.signingConfigs.release.storePassword = storePassword -} diff --git a/app/k9mail-jmap/proguard-rules.pro b/app/k9mail-jmap/proguard-rules.pro deleted file mode 100644 index 7e58794953..0000000000 --- a/app/k9mail-jmap/proguard-rules.pro +++ /dev/null @@ -1,52 +0,0 @@ -# Add project specific ProGuard rules here. - --dontobfuscate - -# Preserve the line number information for debugging stack traces. --keepattributes SourceFile,LineNumberTable - -# Library specific rules --dontnote android.net.http.* --dontnote org.apache.commons.codec.** --dontnote org.apache.http.** --dontnote com.squareup.moshi.** --dontnote com.github.amlcurran.showcaseview.** --dontnote de.cketti.safecontentresolver.** --dontnote com.tokenautocomplete.** --keep class rs.ltt.jmap.common.** {*;} - --dontwarn okio.** --dontwarn com.squareup.moshi.** - -# Glide --keep public class * extends com.bumptech.glide.module.AppGlideModule --keep public class * extends com.bumptech.glide.module.LibraryGlideModule --keep public enum com.bumptech.glide.load.ImageHeaderParser$** { - **[] $VALUES; - public *; -} - -# Project specific rules --dontnote com.fsck.k9.ui.messageview.** --dontnote com.fsck.k9.view.** - --keep public class org.openintents.openpgp.** - --keepclassmembers class * extends androidx.appcompat.widget.SearchView { - public (android.content.Context); -} - -# okhttp rules -# see: https://github.com/square/okhttp/blob/master/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro - -# JSR 305 annotations are for embedding nullability information. --dontwarn javax.annotation.** - -# A resource is loaded with a relative path so the package of this class must be preserved. --keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase - -# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java. --dontwarn org.codehaus.mojo.animal_sniffer.* - -# OkHttp platform used only on JVM and when Conscrypt dependency is available. --dontwarn okhttp3.internal.platform.ConscryptPlatform diff --git a/app/k9mail-jmap/src/main/AndroidManifest.xml b/app/k9mail-jmap/src/main/AndroidManifest.xml deleted file mode 100644 index b44a43704d..0000000000 --- a/app/k9mail-jmap/src/main/AndroidManifest.xml +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/App.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/App.kt deleted file mode 100644 index 1a2c819bab..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/App.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.fsck.k9 - -import android.app.Application -import com.fsck.k9.activity.MessageCompose -import com.fsck.k9.controller.MessagingController -import com.fsck.k9.ui.base.ThemeManager -import org.koin.android.ext.android.inject - -class App : Application() { - private val messagingController: MessagingController by inject() - private val messagingListenerProvider: MessagingListenerProvider by inject() - private val themeManager: ThemeManager by inject() - - override fun onCreate() { - Core.earlyInit() - - super.onCreate() - - DI.start(this, coreModules + uiModules + appModules) - - K9.init(this) - Core.init(this) - themeManager.init() - - messagingListenerProvider.listeners.forEach { listener -> - messagingController.addListener(listener) - } - } - - companion object { - val appConfig = AppConfig( - componentsToDisable = listOf(MessageCompose::class.java) - ) - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/Dependencies.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/Dependencies.kt deleted file mode 100644 index bd33d9b7f0..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/Dependencies.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.fsck.k9 - -import com.fsck.k9.backends.backendsModule -import com.fsck.k9.controller.ControllerExtension -import com.fsck.k9.crypto.EncryptionExtractor -import com.fsck.k9.crypto.openpgp.OpenPgpEncryptionExtractor -import com.fsck.k9.notification.notificationModule -import com.fsck.k9.preferences.K9StoragePersister -import com.fsck.k9.preferences.StoragePersister -import com.fsck.k9.resources.resourcesModule -import com.fsck.k9.storage.storageModule -import com.fsck.k9.ui.addaccount.uiAddAccountModule -import org.koin.core.qualifier.named -import org.koin.dsl.module - -private val mainAppModule = module { - single { App.appConfig } - single { MessagingListenerProvider(emptyList()) } - single(named("controllerExtensions")) { emptyList() } - single { OpenPgpEncryptionExtractor.newInstance() } - single { K9StoragePersister(get()) } -} - -val appModules = listOf( - mainAppModule, - notificationModule, - resourcesModule, - backendsModule, - storageModule, - uiAddAccountModule -) diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/MessagingListenerProvider.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/MessagingListenerProvider.kt deleted file mode 100644 index b81d41af8e..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/MessagingListenerProvider.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.fsck.k9 - -import com.fsck.k9.controller.MessagingListener - -class MessagingListenerProvider(val listeners: List) diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/AndroidAlarmManager.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/AndroidAlarmManager.kt deleted file mode 100644 index a395694589..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/AndroidAlarmManager.kt +++ /dev/null @@ -1,72 +0,0 @@ -package com.fsck.k9.backends - -import android.app.PendingIntent -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -import android.content.IntentFilter -import android.os.Build -import android.os.SystemClock -import com.fsck.k9.backend.imap.SystemAlarmManager -import com.fsck.k9.helper.AlarmManagerCompat -import java.util.concurrent.atomic.AtomicReference -import kotlinx.coroutines.CoroutineDispatcher -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import timber.log.Timber - -private const val ALARM_ACTION = "com.fsck.k9.backends.ALARM" -private const val REQUEST_CODE = 1 - -private typealias Callback = () -> Unit - -class AndroidAlarmManager( - private val context: Context, - private val alarmManager: AlarmManagerCompat, - backgroundDispatcher: CoroutineDispatcher = Dispatchers.IO -) : SystemAlarmManager { - private val coroutineScope = CoroutineScope(backgroundDispatcher) - - private val pendingIntent: PendingIntent = run { - val intent = Intent(ALARM_ACTION).apply { - setPackage(context.packageName) - } - val flags = if (Build.VERSION.SDK_INT >= 23) PendingIntent.FLAG_IMMUTABLE else 0 - - PendingIntent.getBroadcast(context, REQUEST_CODE, intent, flags) - } - - private val callback = AtomicReference(null) - - init { - val intentFilter = IntentFilter(ALARM_ACTION) - context.registerReceiver( - object : BroadcastReceiver() { - override fun onReceive(context: Context?, intent: Intent?) { - val callback = callback.getAndSet(null) - if (callback == null) { - Timber.w("Alarm triggered but 'callback' was null") - } else { - coroutineScope.launch { - callback.invoke() - } - } - } - }, - intentFilter - ) - } - - override fun setAlarm(triggerTime: Long, callback: Callback) { - this.callback.set(callback) - alarmManager.scheduleAlarm(triggerTime, pendingIntent) - } - - override fun cancelAlarm() { - callback.set(null) - alarmManager.cancelAlarm(pendingIntent) - } - - override fun now(): Long = SystemClock.elapsedRealtime() -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt deleted file mode 100644 index e5145469ac..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt +++ /dev/null @@ -1,90 +0,0 @@ -package com.fsck.k9.backends - -import android.content.Context -import android.net.ConnectivityManager -import com.fsck.k9.Account -import com.fsck.k9.backend.BackendFactory -import com.fsck.k9.backend.api.Backend -import com.fsck.k9.backend.imap.ImapBackend -import com.fsck.k9.backend.imap.ImapPushConfigProvider -import com.fsck.k9.mail.NetworkType -import com.fsck.k9.mail.oauth.OAuth2TokenProvider -import com.fsck.k9.mail.power.PowerManager -import com.fsck.k9.mail.ssl.TrustedSocketFactory -import com.fsck.k9.mail.store.imap.IdleRefreshManager -import com.fsck.k9.mail.store.imap.ImapStore -import com.fsck.k9.mail.store.imap.ImapStoreConfig -import com.fsck.k9.mail.transport.smtp.SmtpTransport -import com.fsck.k9.mailstore.K9BackendStorageFactory -import com.fsck.k9.preferences.AccountManager -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.distinctUntilChanged -import kotlinx.coroutines.flow.map - -class ImapBackendFactory( - private val context: Context, - private val accountManager: AccountManager, - private val powerManager: PowerManager, - private val idleRefreshManager: IdleRefreshManager, - private val backendStorageFactory: K9BackendStorageFactory, - private val trustedSocketFactory: TrustedSocketFactory -) : BackendFactory { - override fun createBackend(account: Account): Backend { - val accountName = account.displayName - val backendStorage = backendStorageFactory.createBackendStorage(account) - val imapStore = createImapStore(account) - val pushConfigProvider = createPushConfigProvider(account) - val smtpTransport = createSmtpTransport(account) - - return ImapBackend( - accountName, - backendStorage, - imapStore, - powerManager, - idleRefreshManager, - pushConfigProvider, - smtpTransport - ) - } - - private fun createImapStore(account: Account): ImapStore { - val oAuth2TokenProvider: OAuth2TokenProvider? = null - val config = createImapStoreConfig(account) - return ImapStore.create( - account.incomingServerSettings, - config, - trustedSocketFactory, - context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager, - oAuth2TokenProvider - ) - } - - private fun createImapStoreConfig(account: Account): ImapStoreConfig { - return object : ImapStoreConfig { - override val logLabel - get() = account.description - - override fun isSubscribedFoldersOnly() = account.isSubscribedFoldersOnly - - override fun useCompression(type: NetworkType) = account.useCompression(type) - } - } - - private fun createSmtpTransport(account: Account): SmtpTransport { - val serverSettings = account.outgoingServerSettings - val oauth2TokenProvider: OAuth2TokenProvider? = null - return SmtpTransport(serverSettings, trustedSocketFactory, oauth2TokenProvider) - } - - private fun createPushConfigProvider(account: Account) = object : ImapPushConfigProvider { - override val maxPushFoldersFlow: Flow - get() = accountManager.getAccountFlow(account.uuid) - .map { it.maxPushFolders } - .distinctUntilChanged() - - override val idleRefreshMinutesFlow: Flow - get() = accountManager.getAccountFlow(account.uuid) - .map { it.idleRefreshMinutes } - .distinctUntilChanged() - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/JmapAccountCreator.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/JmapAccountCreator.kt deleted file mode 100644 index ac23638f4d..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/JmapAccountCreator.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.fsck.k9.backends - -import com.fsck.k9.Account -import com.fsck.k9.Preferences -import com.fsck.k9.account.AccountCreator -import com.fsck.k9.backend.BackendManager -import com.fsck.k9.backend.jmap.JmapDiscoveryResult.JmapAccount -import com.fsck.k9.mail.AuthType -import com.fsck.k9.mail.ConnectionSecurity -import com.fsck.k9.mail.FolderType -import com.fsck.k9.mail.ServerSettings -import com.fsck.k9.mailstore.LocalStoreProvider - -class JmapAccountCreator( - private val preferences: Preferences, - private val backendManager: BackendManager, - private val accountCreator: AccountCreator, - private val localStoreProvider: LocalStoreProvider -) { - fun createAccount(emailAddress: String, password: String, jmapAccount: JmapAccount) { - val serverSettings = createServerSettings(emailAddress, password, jmapAccount) - - val account = preferences.newAccount().apply { - email = emailAddress - description = jmapAccount.name - incomingServerSettings = serverSettings - outgoingServerSettings = serverSettings - - chipColor = accountCreator.pickColor() - deletePolicy = Account.DeletePolicy.ON_DELETE - } - - createOutboxFolder(account) - preferences.saveAccount(account) - - fetchFolderList(account) - } - - private fun createServerSettings(emailAddress: String, password: String, jmapAccount: JmapAccount): ServerSettings { - return ServerSettings( - "jmap", - null, - 433, - ConnectionSecurity.SSL_TLS_REQUIRED, - AuthType.PLAIN, - emailAddress, - password, - null, - mapOf("accountId" to jmapAccount.accountId) - ) - } - - private fun createOutboxFolder(account: Account) { - val localStore = localStoreProvider.getInstance(account) - account.outboxFolderId = localStore.createLocalFolder(Account.OUTBOX_NAME, FolderType.OUTBOX) - } - - private fun fetchFolderList(account: Account) { - val backend = backendManager.getBackend(account) - backend.refreshFolderList() - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/JmapBackendFactory.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/JmapBackendFactory.kt deleted file mode 100644 index c6b52e377c..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/JmapBackendFactory.kt +++ /dev/null @@ -1,28 +0,0 @@ -package com.fsck.k9.backends - -import com.fsck.k9.Account -import com.fsck.k9.backend.BackendFactory -import com.fsck.k9.backend.api.Backend -import com.fsck.k9.backend.jmap.JmapBackend -import com.fsck.k9.backend.jmap.JmapConfig -import com.fsck.k9.mailstore.K9BackendStorageFactory - -class JmapBackendFactory( - private val backendStorageFactory: K9BackendStorageFactory, - private val okHttpClientProvider: OkHttpClientProvider -) : BackendFactory { - override fun createBackend(account: Account): Backend { - val backendStorage = backendStorageFactory.createBackendStorage(account) - val okHttpClient = okHttpClientProvider.getOkHttpClient() - - val serverSettings = account.incomingServerSettings - val jmapConfig = JmapConfig( - username = serverSettings.username, - password = serverSettings.password!!, - baseUrl = serverSettings.host, - accountId = serverSettings.extra["accountId"]!! - ) - - return JmapBackend(backendStorage, okHttpClient, jmapConfig) - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/KoinModule.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/KoinModule.kt deleted file mode 100644 index 9a4d7ba32b..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/KoinModule.kt +++ /dev/null @@ -1,39 +0,0 @@ -package com.fsck.k9.backends - -import com.fsck.k9.backend.BackendManager -import com.fsck.k9.backend.imap.BackendIdleRefreshManager -import com.fsck.k9.backend.imap.SystemAlarmManager -import com.fsck.k9.backend.jmap.JmapAccountDiscovery -import com.fsck.k9.mail.store.imap.IdleRefreshManager -import org.koin.dsl.module - -val backendsModule = module { - single { - BackendManager( - mapOf( - "imap" to get(), - "pop3" to get(), - "webdav" to get(), - "jmap" to get() - ) - ) - } - single { - ImapBackendFactory( - context = get(), - accountManager = get(), - powerManager = get(), - idleRefreshManager = get(), - backendStorageFactory = get(), - trustedSocketFactory = get() - ) - } - single { AndroidAlarmManager(context = get(), alarmManager = get()) } - single { BackendIdleRefreshManager(alarmManager = get()) } - single { Pop3BackendFactory(get(), get()) } - single { WebDavBackendFactory(get(), get(), get()) } - single { JmapBackendFactory(get(), get()) } - factory { JmapAccountDiscovery() } - factory { JmapAccountCreator(get(), get(), get(), get()) } - single { OkHttpClientProvider() } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/OkHttpClientProvider.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/OkHttpClientProvider.kt deleted file mode 100644 index ed1dbd14f3..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/OkHttpClientProvider.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.fsck.k9.backends - -import okhttp3.OkHttpClient - -class OkHttpClientProvider { - private var okHttpClient: OkHttpClient? = null - - @Synchronized - fun getOkHttpClient(): OkHttpClient { - return okHttpClient ?: createOkHttpClient().also { okHttpClient = it } - } - - private fun createOkHttpClient(): OkHttpClient { - return OkHttpClient.Builder().build() - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/Pop3BackendFactory.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/Pop3BackendFactory.kt deleted file mode 100644 index 4550f5f175..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/Pop3BackendFactory.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.fsck.k9.backends - -import com.fsck.k9.Account -import com.fsck.k9.backend.BackendFactory -import com.fsck.k9.backend.api.Backend -import com.fsck.k9.backend.pop3.Pop3Backend -import com.fsck.k9.mail.oauth.OAuth2TokenProvider -import com.fsck.k9.mail.ssl.TrustedSocketFactory -import com.fsck.k9.mail.store.pop3.Pop3Store -import com.fsck.k9.mail.transport.smtp.SmtpTransport -import com.fsck.k9.mailstore.K9BackendStorageFactory - -class Pop3BackendFactory( - private val backendStorageFactory: K9BackendStorageFactory, - private val trustedSocketFactory: TrustedSocketFactory -) : BackendFactory { - override fun createBackend(account: Account): Backend { - val accountName = account.displayName - val backendStorage = backendStorageFactory.createBackendStorage(account) - val pop3Store = createPop3Store(account) - val smtpTransport = createSmtpTransport(account) - return Pop3Backend(accountName, backendStorage, pop3Store, smtpTransport) - } - - private fun createPop3Store(account: Account): Pop3Store { - val serverSettings = account.incomingServerSettings - return Pop3Store(serverSettings, trustedSocketFactory) - } - - private fun createSmtpTransport(account: Account): SmtpTransport { - val serverSettings = account.outgoingServerSettings - val oauth2TokenProvider: OAuth2TokenProvider? = null - return SmtpTransport(serverSettings, trustedSocketFactory, oauth2TokenProvider) - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt deleted file mode 100644 index 0098b96e46..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.fsck.k9.backends - -import com.fsck.k9.Account -import com.fsck.k9.backend.BackendFactory -import com.fsck.k9.backend.api.Backend -import com.fsck.k9.backend.webdav.WebDavBackend -import com.fsck.k9.mail.ssl.TrustManagerFactory -import com.fsck.k9.mail.store.webdav.DraftsFolderProvider -import com.fsck.k9.mail.store.webdav.WebDavStore -import com.fsck.k9.mail.transport.WebDavTransport -import com.fsck.k9.mailstore.FolderRepository -import com.fsck.k9.mailstore.K9BackendStorageFactory - -class WebDavBackendFactory( - private val backendStorageFactory: K9BackendStorageFactory, - private val trustManagerFactory: TrustManagerFactory, - private val folderRepository: FolderRepository -) : BackendFactory { - override fun createBackend(account: Account): Backend { - val accountName = account.displayName - val backendStorage = backendStorageFactory.createBackendStorage(account) - val serverSettings = account.incomingServerSettings - val draftsFolderProvider = createDraftsFolderProvider(account) - val webDavStore = WebDavStore(trustManagerFactory, serverSettings, draftsFolderProvider) - val webDavTransport = WebDavTransport(trustManagerFactory, serverSettings, draftsFolderProvider) - return WebDavBackend(accountName, backendStorage, webDavStore, webDavTransport) - } - - private fun createDraftsFolderProvider(account: Account): DraftsFolderProvider { - return DraftsFolderProvider { - val draftsFolderId = account.draftsFolderId ?: error("No Drafts folder configured") - folderRepository.getFolderServerId(account, draftsFolderId) ?: error("Couldn't find local Drafts folder") - } - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/glide/K9AppGlideModule.java b/app/k9mail-jmap/src/main/java/com/fsck/k9/glide/K9AppGlideModule.java deleted file mode 100644 index f37999f7f1..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/glide/K9AppGlideModule.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.fsck.k9.glide; - -import com.bumptech.glide.annotation.GlideModule; -import com.bumptech.glide.module.AppGlideModule; - -@GlideModule -public class K9AppGlideModule extends AppGlideModule { -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt deleted file mode 100644 index 33b59551f6..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt +++ /dev/null @@ -1,234 +0,0 @@ -package com.fsck.k9.notification - -import android.app.PendingIntent -import android.content.Context -import android.content.Intent -import com.fsck.k9.Account -import com.fsck.k9.K9 -import com.fsck.k9.activity.MessageList -import com.fsck.k9.activity.compose.MessageActions -import com.fsck.k9.activity.setup.AccountSetupIncoming -import com.fsck.k9.activity.setup.AccountSetupOutgoing -import com.fsck.k9.controller.MessageReference -import com.fsck.k9.search.LocalSearch -import com.fsck.k9.ui.messagelist.DefaultFolderProvider -import com.fsck.k9.ui.notification.DeleteConfirmationActivity - -/** - * This class contains methods to create the [PendingIntent]s for the actions of our notifications. - * - * **Note:** - * We need to take special care to ensure the `PendingIntent`s are unique as defined in the documentation of - * [PendingIntent]. Otherwise selecting a notification action might perform the action on the wrong message. - * - * We use the notification ID as `requestCode` argument to ensure each notification/action pair gets a unique - * `PendingIntent`. - */ -internal class K9NotificationActionCreator( - private val context: Context, - private val defaultFolderProvider: DefaultFolderProvider -) : NotificationActionCreator { - - override fun createViewMessagePendingIntent( - messageReference: MessageReference, - notificationId: Int - ): PendingIntent { - val intent = createMessageViewIntent(messageReference) - return PendingIntent.getActivity(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createViewFolderPendingIntent(account: Account, folderId: Long, notificationId: Int): PendingIntent { - val intent = createMessageListIntent(account, folderId) - return PendingIntent.getActivity(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createViewMessagesPendingIntent( - account: Account, - messageReferences: List, - notificationId: Int - ): PendingIntent { - val folderServerId = getFolderIdOfAllMessages(messageReferences) - val intent = if (folderServerId != null) { - createMessageListIntent(account, folderServerId) - } else { - createMessageListIntent(account) - } - - return PendingIntent.getActivity(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createViewFolderListPendingIntent(account: Account, notificationId: Int): PendingIntent { - val intent = createMessageListIntent(account) - return PendingIntent.getActivity(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createDismissAllMessagesPendingIntent(account: Account, notificationId: Int): PendingIntent { - val intent = NotificationActionService.createDismissAllMessagesIntent(context, account) - return PendingIntent.getService(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createDismissMessagePendingIntent( - messageReference: MessageReference, - notificationId: Int - ): PendingIntent { - val intent = NotificationActionService.createDismissMessageIntent(context, messageReference) - return PendingIntent.getService(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createReplyPendingIntent(messageReference: MessageReference, notificationId: Int): PendingIntent { - val intent = MessageActions.getActionReplyIntent(context, messageReference) - return PendingIntent.getActivity(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createMarkMessageAsReadPendingIntent( - messageReference: MessageReference, - notificationId: Int - ): PendingIntent { - val intent = NotificationActionService.createMarkMessageAsReadIntent(context, messageReference) - return PendingIntent.getService(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createMarkAllAsReadPendingIntent( - account: Account, - messageReferences: List, - notificationId: Int - ): PendingIntent { - val accountUuid = account.uuid - val intent = NotificationActionService.createMarkAllAsReadIntent(context, accountUuid, messageReferences) - return PendingIntent.getService(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun getEditIncomingServerSettingsIntent(account: Account): PendingIntent { - val intent = AccountSetupIncoming.intentActionEditIncomingSettings(context, account) - return PendingIntent.getActivity(context, account.accountNumber, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun getEditOutgoingServerSettingsIntent(account: Account): PendingIntent { - val intent = AccountSetupOutgoing.intentActionEditOutgoingSettings(context, account) - return PendingIntent.getActivity(context, account.accountNumber, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createDeleteMessagePendingIntent( - messageReference: MessageReference, - notificationId: Int - ): PendingIntent { - return if (K9.isConfirmDeleteFromNotification) { - createDeleteConfirmationPendingIntent(messageReference, notificationId) - } else { - createDeleteServicePendingIntent(messageReference, notificationId) - } - } - - private fun createDeleteServicePendingIntent( - messageReference: MessageReference, - notificationId: Int - ): PendingIntent { - val intent = NotificationActionService.createDeleteMessageIntent(context, messageReference) - return PendingIntent.getService(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - private fun createDeleteConfirmationPendingIntent( - messageReference: MessageReference, - notificationId: Int - ): PendingIntent { - val intent = DeleteConfirmationActivity.getIntent(context, messageReference) - return PendingIntent.getActivity(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createDeleteAllPendingIntent( - account: Account, - messageReferences: List, - notificationId: Int - ): PendingIntent { - return if (K9.isConfirmDeleteFromNotification) { - getDeleteAllConfirmationPendingIntent(messageReferences, notificationId) - } else { - getDeleteAllServicePendingIntent(account, messageReferences, notificationId) - } - } - - private fun getDeleteAllConfirmationPendingIntent( - messageReferences: List, - notificationId: Int - ): PendingIntent { - val intent = DeleteConfirmationActivity.getIntent(context, messageReferences) - return PendingIntent.getActivity(context, notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT) - } - - private fun getDeleteAllServicePendingIntent( - account: Account, - messageReferences: List, - notificationId: Int - ): PendingIntent { - val accountUuid = account.uuid - val intent = NotificationActionService.createDeleteAllMessagesIntent(context, accountUuid, messageReferences) - return PendingIntent.getService(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createArchiveMessagePendingIntent( - messageReference: MessageReference, - notificationId: Int - ): PendingIntent { - val intent = NotificationActionService.createArchiveMessageIntent(context, messageReference) - return PendingIntent.getService(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createArchiveAllPendingIntent( - account: Account, - messageReferences: List, - notificationId: Int - ): PendingIntent { - val intent = NotificationActionService.createArchiveAllIntent(context, account, messageReferences) - return PendingIntent.getService(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - override fun createMarkMessageAsSpamPendingIntent( - messageReference: MessageReference, - notificationId: Int - ): PendingIntent { - val intent = NotificationActionService.createMarkMessageAsSpamIntent(context, messageReference) - return PendingIntent.getService(context, notificationId, intent, PendingIntent.FLAG_UPDATE_CURRENT) - } - - private fun createMessageListIntent(account: Account): Intent { - val folderId = defaultFolderProvider.getDefaultFolder(account) - val search = LocalSearch().apply { - addAllowedFolder(folderId) - addAccountUuid(account.uuid) - } - - return MessageList.intentDisplaySearch( - context = context, - search = search, - noThreading = false, - newTask = true, - clearTop = true - ) - } - - private fun createMessageListIntent(account: Account, folderId: Long): Intent { - val search = LocalSearch().apply { - addAllowedFolder(folderId) - addAccountUuid(account.uuid) - } - - return MessageList.intentDisplaySearch( - context = context, - search = search, - noThreading = false, - newTask = true, - clearTop = true - ) - } - - private fun createMessageViewIntent(message: MessageReference): Intent { - return MessageList.actionDisplayMessageIntent(context, message) - } - - private fun getFolderIdOfAllMessages(messageReferences: List): Long? { - val firstMessage = messageReferences.first() - val folderId = firstMessage.folderId - - return if (messageReferences.all { it.folderId == folderId }) folderId else null - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationResourceProvider.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationResourceProvider.kt deleted file mode 100644 index 0cea5e4c11..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationResourceProvider.kt +++ /dev/null @@ -1,100 +0,0 @@ -package com.fsck.k9.notification - -import android.content.Context -import com.fsck.k9.jmap.R - -class K9NotificationResourceProvider(private val context: Context) : NotificationResourceProvider { - override val iconWarning: Int = R.drawable.notification_icon_warning - override val iconMarkAsRead: Int = R.drawable.notification_action_mark_as_read - override val iconDelete: Int = R.drawable.notification_action_delete - override val iconReply: Int = R.drawable.notification_action_reply - override val iconNewMail: Int = R.drawable.notification_icon_new_mail - override val iconSendingMail: Int = R.drawable.notification_icon_check_mail - override val iconCheckingMail: Int = R.drawable.notification_icon_check_mail - override val wearIconMarkAsRead: Int = R.drawable.notification_action_mark_as_read - override val wearIconDelete: Int = R.drawable.notification_action_delete - override val wearIconArchive: Int = R.drawable.notification_action_archive - override val wearIconReplyAll: Int = R.drawable.notification_action_reply - override val wearIconMarkAsSpam: Int = R.drawable.notification_action_mark_as_spam - - override val pushChannelName: String - get() = context.getString(R.string.notification_channel_push_title) - override val pushChannelDescription: String - get() = context.getString(R.string.notification_channel_push_description) - override val messagesChannelName: String - get() = context.getString(R.string.notification_channel_messages_title) - override val messagesChannelDescription: String - get() = context.getString(R.string.notification_channel_messages_description) - override val miscellaneousChannelName: String - get() = context.getString(R.string.notification_channel_miscellaneous_title) - override val miscellaneousChannelDescription: String - get() = context.getString(R.string.notification_channel_miscellaneous_description) - - override fun authenticationErrorTitle(): String = - context.getString(R.string.notification_authentication_error_title) - - override fun authenticationErrorBody(accountName: String): String = - context.getString(R.string.notification_authentication_error_text, accountName) - - override fun certificateErrorTitle(): String = context.getString(R.string.notification_certificate_error_public) - - override fun certificateErrorTitle(accountName: String): String = - context.getString(R.string.notification_certificate_error_title, accountName) - - override fun certificateErrorBody(): String = context.getString(R.string.notification_certificate_error_text) - - override fun newMailTitle(): String = context.getString(R.string.notification_new_title) - - override fun newMailUnreadMessageCount(unreadMessageCount: Int, accountName: String): String = - context.getString(R.string.notification_new_one_account_fmt, unreadMessageCount, accountName) - - override fun newMessagesTitle(newMessagesCount: Int): String = - context.resources.getQuantityString( - R.plurals.notification_new_messages_title, - newMessagesCount, newMessagesCount - ) - - override fun additionalMessages(overflowMessagesCount: Int, accountName: String): String = - context.getString(R.string.notification_additional_messages, overflowMessagesCount, accountName) - - override fun previewEncrypted(): String = context.getString(R.string.preview_encrypted) - - override fun noSubject(): String = context.getString(R.string.general_no_subject) - - override fun recipientDisplayName(recipientDisplayName: String): String = - context.getString(R.string.message_to_fmt, recipientDisplayName) - - override fun noSender(): String = context.getString(R.string.general_no_sender) - - override fun sendFailedTitle(): String = context.getString(R.string.send_failure_subject) - - override fun sendingMailTitle(): String = context.getString(R.string.notification_bg_send_title) - - override fun sendingMailBody(accountName: String): String = - context.getString(R.string.notification_bg_send_ticker, accountName) - - override fun checkingMailTicker(accountName: String, folderName: String): String = - context.getString(R.string.notification_bg_sync_ticker, accountName, folderName) - - override fun checkingMailTitle(): String = - context.getString(R.string.notification_bg_sync_title) - - override fun checkingMailSeparator(): String = - context.getString(R.string.notification_bg_title_separator) - - override fun actionMarkAsRead(): String = context.getString(R.string.notification_action_mark_as_read) - - override fun actionMarkAllAsRead(): String = context.getString(R.string.notification_action_mark_all_as_read) - - override fun actionDelete(): String = context.getString(R.string.notification_action_delete) - - override fun actionDeleteAll(): String = context.getString(R.string.notification_action_delete_all) - - override fun actionReply(): String = context.getString(R.string.notification_action_reply) - - override fun actionArchive(): String = context.getString(R.string.notification_action_archive) - - override fun actionArchiveAll(): String = context.getString(R.string.notification_action_archive_all) - - override fun actionMarkAsSpam(): String = context.getString(R.string.notification_action_spam) -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt deleted file mode 100644 index 95fe647781..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt +++ /dev/null @@ -1,69 +0,0 @@ -package com.fsck.k9.notification - -import com.fsck.k9.Account -import com.fsck.k9.K9 -import com.fsck.k9.helper.Contacts -import com.fsck.k9.mail.Flag -import com.fsck.k9.mailstore.LocalFolder -import com.fsck.k9.mailstore.LocalMessage - -class K9NotificationStrategy(val contacts: Contacts) : NotificationStrategy { - - override fun shouldNotifyForMessage( - account: Account, - localFolder: LocalFolder, - message: LocalMessage, - isOldMessage: Boolean - ): Boolean { - - // If we don't even have an account name, don't show the notification. - // (This happens during initial account setup) - if (account.name == null) { - return false - } - - if (K9.isQuietTime && !K9.isNotificationDuringQuietTimeEnabled) { - return false - } - - // Do not notify if the user does not have notifications enabled or if the message has - // been read. - if (!account.isNotifyNewMail || message.isSet(Flag.SEEN) || isOldMessage) { - return false - } - - val aDisplayMode = account.folderDisplayMode - val aNotifyMode = account.folderNotifyNewMailMode - val fDisplayClass = localFolder.displayClass - val fNotifyClass = localFolder.notifyClass - - if (LocalFolder.isModeMismatch(aDisplayMode, fDisplayClass)) { - // Never notify a folder that isn't displayed - return false - } - - if (LocalFolder.isModeMismatch(aNotifyMode, fNotifyClass)) { - // Do not notify folders in the wrong class - return false - } - - // No notification for new messages in Trash, Drafts, Spam or Sent folder. - val folder = message.folder - if (folder != null) { - val folderId = folder.databaseId - if (folderId == account.trashFolderId || - folderId == account.draftsFolderId || - folderId == account.spamFolderId || - folderId == account.sentFolderId - ) { - return false - } - } - - // Don't notify if the sender address matches one of our identities and the user chose not - // to be notified for such messages. - return if (account.isAnIdentity(message.from) && !account.isNotifySelfNewMail) { - false - } else !account.isNotifyContactsMailOnly || contacts.isAnyInContacts(message.from) - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/KoinModule.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/KoinModule.kt deleted file mode 100644 index ac5ee21308..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/notification/KoinModule.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.fsck.k9.notification - -import org.koin.dsl.module - -val notificationModule = module { - single { K9NotificationActionCreator(context = get(), defaultFolderProvider = get()) } - single { K9NotificationResourceProvider(get()) } - single { K9NotificationStrategy(get()) } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/resources/K9AutocryptStringProvider.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/resources/K9AutocryptStringProvider.kt deleted file mode 100644 index eb6ad899ba..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/resources/K9AutocryptStringProvider.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.fsck.k9.resources - -import android.content.Context -import com.fsck.k9.autocrypt.AutocryptStringProvider -import com.fsck.k9.jmap.R - -class K9AutocryptStringProvider(private val context: Context) : AutocryptStringProvider { - override fun transferMessageSubject(): String = context.getString(R.string.ac_transfer_msg_subject) - override fun transferMessageBody(): String = context.getString(R.string.ac_transfer_msg_body) -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/resources/K9CoreResourceProvider.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/resources/K9CoreResourceProvider.kt deleted file mode 100644 index 6c46f88f2d..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/resources/K9CoreResourceProvider.kt +++ /dev/null @@ -1,52 +0,0 @@ -package com.fsck.k9.resources - -import android.content.Context -import com.fsck.k9.CoreResourceProvider -import com.fsck.k9.jmap.R -import com.fsck.k9.notification.PushNotificationState - -class K9CoreResourceProvider(private val context: Context) : CoreResourceProvider { - override fun defaultSignature(): String = context.getString(R.string.default_signature) - override fun defaultIdentityDescription(): String = context.getString(R.string.default_identity_description) - - override fun contactDisplayNamePrefix(): String = context.getString(R.string.message_to_label) - override fun contactUnknownSender(): String = context.getString(R.string.unknown_sender) - override fun contactUnknownRecipient(): String = context.getString(R.string.unknown_recipient) - - override fun messageHeaderFrom(): String = context.getString(R.string.message_compose_quote_header_from) - override fun messageHeaderTo(): String = context.getString(R.string.message_compose_quote_header_to) - override fun messageHeaderCc(): String = context.getString(R.string.message_compose_quote_header_cc) - override fun messageHeaderDate(): String = context.getString(R.string.message_compose_quote_header_send_date) - override fun messageHeaderSubject(): String = context.getString(R.string.message_compose_quote_header_subject) - override fun messageHeaderSeparator(): String = context.getString(R.string.message_compose_quote_header_separator) - - override fun noSubject(): String = context.getString(R.string.general_no_subject) - - override fun userAgent(): String = context.getString(R.string.message_header_mua) - override fun encryptedSubject(): String = context.getString(R.string.encrypted_subject) - - override fun replyHeader(sender: String): String = - context.getString(R.string.message_compose_reply_header_fmt, sender) - - override fun replyHeader(sender: String, sentDate: String): String = - context.getString(R.string.message_compose_reply_header_fmt_with_date, sentDate, sender) - - override fun searchUnifiedInboxTitle(): String = context.getString(R.string.integrated_inbox_title) - override fun searchUnifiedInboxDetail(): String = context.getString(R.string.integrated_inbox_detail) - - override fun outboxFolderName(): String = context.getString(R.string.special_mailbox_name_outbox) - - override val iconPushNotification: Int = R.drawable.ic_push_notification - - override fun pushNotificationText(notificationState: PushNotificationState): String { - val resId = when (notificationState) { - PushNotificationState.INITIALIZING -> R.string.push_notification_state_initializing - PushNotificationState.LISTENING -> R.string.push_notification_state_listening - PushNotificationState.WAIT_BACKGROUND_SYNC -> R.string.push_notification_state_wait_background_sync - PushNotificationState.WAIT_NETWORK -> R.string.push_notification_state_wait_network - } - return context.getString(resId) - } - - override fun pushNotificationInfoText(): String = context.getString(R.string.push_notification_info) -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/resources/KoinModule.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/resources/KoinModule.kt deleted file mode 100644 index a54e8ec109..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/resources/KoinModule.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.fsck.k9.resources - -import com.fsck.k9.CoreResourceProvider -import com.fsck.k9.autocrypt.AutocryptStringProvider -import org.koin.dsl.module - -val resourcesModule = module { - single { K9CoreResourceProvider(get()) } - single { K9AutocryptStringProvider(get()) } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/DataBindingAdapters.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/DataBindingAdapters.kt deleted file mode 100644 index da71765169..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/DataBindingAdapters.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.fsck.k9.ui - -import android.view.View -import androidx.core.view.isVisible -import androidx.databinding.BindingAdapter -import com.google.android.material.textfield.TextInputLayout - -@BindingAdapter("isVisible") -fun setVisibility(view: View, value: Boolean) { - view.isVisible = value -} - -@BindingAdapter("error") -fun setError(view: TextInputLayout, value: Int?) { - if (value == null) { - view.error = null - } else { - val errorString = view.context.getString(value) - view.error = errorString - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountActivity.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountActivity.kt deleted file mode 100644 index bade75d0f3..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountActivity.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.fsck.k9.ui.addaccount - -import android.os.Bundle -import androidx.navigation.NavController -import androidx.navigation.ui.AppBarConfiguration -import androidx.navigation.ui.setupActionBarWithNavController -import com.fsck.k9.jmap.R -import com.fsck.k9.ui.base.K9Activity -import com.fsck.k9.ui.base.extensions.findNavController - -class AddAccountActivity : K9Activity() { - private lateinit var navController: NavController - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setLayout(R.layout.activity_add_account) - - initializeActionBar() - } - - private fun initializeActionBar() { - val appBarConfiguration = AppBarConfiguration(topLevelDestinationIds = setOf(R.id.addJmapAccountScreen)) - - navController = findNavController(R.id.nav_host_fragment) - setupActionBarWithNavController(navController, appBarConfiguration) - } - - override fun onSupportNavigateUp(): Boolean { - return navController.navigateUp() || super.onSupportNavigateUp() - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountFragment.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountFragment.kt deleted file mode 100644 index 4fba3d4189..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountFragment.kt +++ /dev/null @@ -1,39 +0,0 @@ -package com.fsck.k9.ui.addaccount - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.fragment.app.Fragment -import androidx.navigation.fragment.findNavController -import com.fsck.k9.jmap.R -import com.fsck.k9.jmap.databinding.FragmentAddAccountBinding -import com.fsck.k9.ui.observeNotNull -import org.koin.androidx.viewmodel.ext.android.viewModel - -class AddAccountFragment : Fragment() { - private val viewModel: AddAccountViewModel by viewModel() - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - viewModel.getActionEvents().observeNotNull(this) { handleActionEvents(it) } - } - - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - val binding = FragmentAddAccountBinding.inflate(inflater, container, false) - binding.lifecycleOwner = this - binding.viewModel = viewModel - - return binding.root - } - - private fun handleActionEvents(action: Action) { - when (action) { - is Action.GoToMessageList -> goToMessageList() - } - } - - private fun goToMessageList() { - findNavController().navigate(R.id.action_addJmapAccountScreen_to_messageListScreen) - } -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountViewModel.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountViewModel.kt deleted file mode 100644 index c97ca46753..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/AddAccountViewModel.kt +++ /dev/null @@ -1,157 +0,0 @@ -package com.fsck.k9.ui.addaccount - -import androidx.annotation.StringRes -import androidx.lifecycle.LiveData -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.Transformations -import androidx.lifecycle.ViewModel -import androidx.lifecycle.viewModelScope -import com.fsck.k9.EmailAddressValidator -import com.fsck.k9.backend.jmap.JmapAccountDiscovery -import com.fsck.k9.backend.jmap.JmapDiscoveryResult -import com.fsck.k9.backend.jmap.JmapDiscoveryResult.JmapAccount -import com.fsck.k9.backends.JmapAccountCreator -import com.fsck.k9.helper.SingleLiveEvent -import com.fsck.k9.helper.measureRealtimeMillisWithResult -import com.fsck.k9.jmap.R -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.delay -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext - -class AddAccountViewModel( - private val emailAddressValidator: EmailAddressValidator, - private val jmapAccountDiscovery: JmapAccountDiscovery, - private val jmapAccountCreator: JmapAccountCreator -) : ViewModel() { - val emailAddress = MutableLiveData() - val emailAddressError = MutableLiveData() - val password = MutableLiveData() - val passwordError = MutableLiveData() - val setupErrorText: MutableLiveData = createMutableLiveData(R.string.empty_string) - val isInputEnabled: MutableLiveData = createMutableLiveData(true) - val isNextButtonEnabled: MutableLiveData = createMutableLiveData(true) - val isProgressBarVisible: MutableLiveData = createMutableLiveData(false) - private val actionLiveData = SingleLiveEvent() - - init { - Transformations.distinctUntilChanged(emailAddress).observeForever { resetEmailAddressError() } - Transformations.distinctUntilChanged(password).observeForever { resetPasswordError() } - } - - fun getActionEvents(): LiveData = actionLiveData - - fun onNextButtonClicked() { - discoverServerSettings() - } - - private fun discoverServerSettings() { - val emailAddress = this.emailAddress.value?.trim() ?: "" - val password = this.password.value ?: "" - - if (!emailAddressValidator.isValidAddressOnly(emailAddress)) { - displayEmailAddressError(R.string.add_account__email_address_error) - return - } - - showDiscoveryProgressBar() - - viewModelScope.launch { - val (elapsed, discoveryResult) = measureRealtimeMillisWithResult { - withContext(Dispatchers.IO) { - jmapAccountDiscovery.discover(emailAddress, password) - } - } - - if (elapsed < MIN_PROGRESS_DURATION) { - delay(MIN_PROGRESS_DURATION - elapsed) - } - - if (discoveryResult is JmapAccount) { - createAccount(emailAddress, password, discoveryResult) - } else { - displayDiscoveryError(discoveryResult) - hideDiscoveryProgressBar() - } - } - } - - private suspend fun createAccount(emailAddress: String, password: String, jmapAccount: JmapAccount) { - GlobalScope.launch(Dispatchers.IO) { - jmapAccountCreator.createAccount(emailAddress, password, jmapAccount) - }.join() - - sendActionEvent(Action.GoToMessageList) - } - - private fun displayDiscoveryError(discoveryResult: JmapDiscoveryResult) { - when (discoveryResult) { - is JmapDiscoveryResult.GenericFailure -> { - displayError(R.string.add_account__generic_failure) - } - is JmapDiscoveryResult.NoEmailAccountFoundFailure -> { - displayError(R.string.add_account__no_email_account_found) - } - is JmapDiscoveryResult.AuthenticationFailure -> { - displayPasswordError(R.string.add_account__password_error) - } - is JmapDiscoveryResult.EndpointNotFoundFailure -> { - displayError(R.string.add_account__jmap_server_not_found) - } - } - } - - @Suppress("SameParameterValue") - private fun displayEmailAddressError(@StringRes error: Int) { - emailAddressError.value = error - } - - private fun resetEmailAddressError() { - emailAddressError.value = null - } - - @Suppress("SameParameterValue") - private fun displayPasswordError(@StringRes error: Int) { - passwordError.value = error - } - - private fun resetPasswordError() { - passwordError.value = null - } - - private fun showDiscoveryProgressBar() { - isInputEnabled.value = false - isProgressBarVisible.value = true - isNextButtonEnabled.value = false - setupErrorText.value = R.string.empty_string - } - - private fun hideDiscoveryProgressBar() { - isInputEnabled.value = true - isProgressBarVisible.value = false - isNextButtonEnabled.value = true - } - - private fun displayError(@StringRes error: Int) { - setupErrorText.value = error - } - - private fun sendActionEvent(action: Action) { - actionLiveData.value = action - } - - private fun createMutableLiveData(initialValue: T): MutableLiveData { - return MutableLiveData().apply { - value = initialValue - } - } - - companion object { - private const val MIN_PROGRESS_DURATION = 500 - } -} - -sealed class Action { - object GoToMessageList : Action() -} diff --git a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/KoinModule.kt b/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/KoinModule.kt deleted file mode 100644 index 0efa1daecc..0000000000 --- a/app/k9mail-jmap/src/main/java/com/fsck/k9/ui/addaccount/KoinModule.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.fsck.k9.ui.addaccount - -import org.koin.androidx.viewmodel.dsl.viewModel -import org.koin.dsl.module - -val uiAddAccountModule = module { - viewModel { AddAccountViewModel(get(), get(), get()) } -} diff --git a/app/k9mail-jmap/src/main/res/layout/activity_add_account.xml b/app/k9mail-jmap/src/main/res/layout/activity_add_account.xml deleted file mode 100644 index 57258b0684..0000000000 --- a/app/k9mail-jmap/src/main/res/layout/activity_add_account.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - diff --git a/app/k9mail-jmap/src/main/res/layout/fragment_add_account.xml b/app/k9mail-jmap/src/main/res/layout/fragment_add_account.xml deleted file mode 100644 index fe5d170138..0000000000 --- a/app/k9mail-jmap/src/main/res/layout/fragment_add_account.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -