Loading config/detekt/detekt-baseline-legacy-common.xml +0 −2 Original line number Diff line number Diff line Loading @@ -2,8 +2,6 @@ <SmellBaseline> <ManuallySuppressedIssues></ManuallySuppressedIssues> <CurrentIssues> <ID>CyclomaticComplexMethod:K9NotificationStrategy.kt$K9NotificationStrategy$override fun shouldNotifyForMessage( account: Account, localFolder: LocalFolder, message: LocalMessage, isOldMessage: Boolean, ): Boolean</ID> <ID>LongMethod:K9NotificationStrategy.kt$K9NotificationStrategy$override fun shouldNotifyForMessage( account: Account, localFolder: LocalFolder, message: LocalMessage, isOldMessage: Boolean, ): Boolean</ID> <ID>ReturnCount:K9NotificationStrategy.kt$K9NotificationStrategy$override fun shouldNotifyForMessage( account: Account, localFolder: LocalFolder, message: LocalMessage, isOldMessage: Boolean, ): Boolean</ID> <ID>TooManyFunctions:K9CoreResourceProvider.kt$K9CoreResourceProvider : CoreResourceProvider</ID> <ID>TooManyFunctions:K9NotificationActionCreator.kt$K9NotificationActionCreator : NotificationActionCreator</ID> Loading config/detekt/detekt-baseline-legacy-storage.xml +0 −21 Original line number Diff line number Diff line Loading @@ -41,27 +41,6 @@ <ID>MagicNumber:MigrationTo84.kt$MigrationTo84$3</ID> <ID>MagicNumber:MigrationTo84.kt$MigrationTo84$4</ID> <ID>MagicNumber:MigrationTo84.kt$MigrationTo84$5</ID> <ID>MagicNumber:Migrations.kt$Migrations$62</ID> <ID>MagicNumber:Migrations.kt$Migrations$64</ID> <ID>MagicNumber:Migrations.kt$Migrations$65</ID> <ID>MagicNumber:Migrations.kt$Migrations$66</ID> <ID>MagicNumber:Migrations.kt$Migrations$67</ID> <ID>MagicNumber:Migrations.kt$Migrations$68</ID> <ID>MagicNumber:Migrations.kt$Migrations$69</ID> <ID>MagicNumber:Migrations.kt$Migrations$70</ID> <ID>MagicNumber:Migrations.kt$Migrations$71</ID> <ID>MagicNumber:Migrations.kt$Migrations$72</ID> <ID>MagicNumber:Migrations.kt$Migrations$73</ID> <ID>MagicNumber:Migrations.kt$Migrations$74</ID> <ID>MagicNumber:Migrations.kt$Migrations$75</ID> <ID>MagicNumber:Migrations.kt$Migrations$76</ID> <ID>MagicNumber:Migrations.kt$Migrations$78</ID> <ID>MagicNumber:Migrations.kt$Migrations$79</ID> <ID>MagicNumber:Migrations.kt$Migrations$80</ID> <ID>MagicNumber:Migrations.kt$Migrations$81</ID> <ID>MagicNumber:Migrations.kt$Migrations$82</ID> <ID>MagicNumber:Migrations.kt$Migrations$83</ID> <ID>MagicNumber:Migrations.kt$Migrations$84</ID> <ID>MagicNumber:RetrieveFolderOperations.kt$CursorFolderAccessor$10</ID> <ID>MagicNumber:RetrieveFolderOperations.kt$CursorFolderAccessor$11</ID> <ID>MagicNumber:RetrieveFolderOperations.kt$CursorFolderAccessor$12</ID> Loading legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt +2 −27 Original line number Diff line number Diff line Loading @@ -32,38 +32,13 @@ class K9NotificationStrategy( return false } val folder = message.folder if (folder != null) { when (folder.databaseId) { account.inboxFolderId -> { // Don't skip notifications if the Inbox folder is also configured as another special folder } account.trashFolderId -> { Timber.v("No notification: Message is in Trash folder") return false } account.draftsFolderId -> { Timber.v("No notification: Message is in Drafts folder") return false } account.spamFolderId -> { Timber.v("No notification: Message is in Spam folder") return false } account.sentFolderId -> { Timber.v("No notification: Message is in Sent folder") return false } } } if (isModeMismatch(account.folderDisplayMode, localFolder.displayClass)) { Timber.v("No notification: Message is in folder not being displayed") return false } if (isModeMismatch(account.folderNotifyNewMailMode, localFolder.notifyClass)) { Timber.v("No notification: Notifications are disabled for this folder class") if (!localFolder.isNotificationsEnabled) { Timber.v("No notification: Notifications are not enabled for this folder") return false } Loading legacy/core/src/main/java/com/fsck/k9/mailstore/FolderSettingsProvider.kt +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ class FolderSettingsProvider(val preferences: Preferences, val account: Account) visibleLimit = account.displayCount, displayClass = storage.getString("$prefix.displayMode", null).toFolderClass(FolderClass.NO_CLASS), syncClass = storage.getString("$prefix.syncMode", null).toFolderClass(FolderClass.INHERITED), notifyClass = storage.getString("$prefix.notifyMode", null).toFolderClass(FolderClass.INHERITED), isNotificationsEnabled = storage.getBoolean("$prefix.notificationsEnabled", false), pushClass = storage.getString("$prefix.pushMode", null).toFolderClass(FolderClass.SECOND_CLASS), inTopGroup = storage.getBoolean("$prefix.inTopGroup", false), integrate = storage.getBoolean("$prefix.integrate", false), Loading @@ -31,7 +31,7 @@ class FolderSettingsProvider(val preferences: Preferences, val account: Account) editor.remove("$prefix.displayMode") editor.remove("$prefix.syncMode") editor.remove("$prefix.notifyMode") editor.remove("$prefix.notificationsEnabled") editor.remove("$prefix.pushMode") editor.remove("$prefix.inTopGroup") editor.remove("$prefix.integrate") Loading legacy/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java +4 −10 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ public class LocalFolder { private FolderClass displayClass = FolderClass.NO_CLASS; private FolderClass syncClass = FolderClass.INHERITED; private FolderClass pushClass = FolderClass.SECOND_CLASS; private FolderClass notifyClass = FolderClass.INHERITED; private boolean notificationsEnabled = false; private boolean isInTopGroup = false; private boolean isIntegrate = false; Loading Loading @@ -177,8 +177,7 @@ public class LocalFolder { String noClass = FolderClass.NO_CLASS.toString(); String displayClass = cursor.getString(LocalStore.FOLDER_DISPLAY_CLASS_INDEX); this.displayClass = FolderClass.valueOf((displayClass == null) ? noClass : displayClass); String notifyClass = cursor.getString(LocalStore.FOLDER_NOTIFY_CLASS_INDEX); this.notifyClass = FolderClass.valueOf((notifyClass == null) ? noClass : notifyClass); this.notificationsEnabled = cursor.getInt(LocalStore.FOLDER_NOTIFICATIONS_ENABLED_INDEX) == 1; String pushClass = cursor.getString(LocalStore.FOLDER_PUSH_CLASS_INDEX); this.pushClass = FolderClass.valueOf((pushClass == null) ? noClass : pushClass); String syncClass = cursor.getString(LocalStore.FOLDER_SYNC_CLASS_INDEX); Loading Loading @@ -308,10 +307,6 @@ public class LocalFolder { return (FolderClass.INHERITED == syncClass) ? getDisplayClass() : syncClass; } public FolderClass getNotifyClass() { return (FolderClass.INHERITED == notifyClass) ? getPushClass() : notifyClass; } public FolderClass getPushClass() { return (FolderClass.INHERITED == pushClass) ? getSyncClass() : pushClass; } Loading @@ -331,9 +326,8 @@ public class LocalFolder { updateFolderColumn("push_class", this.pushClass.name()); } public void setNotifyClass(FolderClass notifyClass) throws MessagingException { this.notifyClass = notifyClass; updateFolderColumn("notify_class", this.notifyClass.name()); public boolean isNotificationsEnabled() { return notificationsEnabled; } public boolean isIntegrate() { Loading Loading
config/detekt/detekt-baseline-legacy-common.xml +0 −2 Original line number Diff line number Diff line Loading @@ -2,8 +2,6 @@ <SmellBaseline> <ManuallySuppressedIssues></ManuallySuppressedIssues> <CurrentIssues> <ID>CyclomaticComplexMethod:K9NotificationStrategy.kt$K9NotificationStrategy$override fun shouldNotifyForMessage( account: Account, localFolder: LocalFolder, message: LocalMessage, isOldMessage: Boolean, ): Boolean</ID> <ID>LongMethod:K9NotificationStrategy.kt$K9NotificationStrategy$override fun shouldNotifyForMessage( account: Account, localFolder: LocalFolder, message: LocalMessage, isOldMessage: Boolean, ): Boolean</ID> <ID>ReturnCount:K9NotificationStrategy.kt$K9NotificationStrategy$override fun shouldNotifyForMessage( account: Account, localFolder: LocalFolder, message: LocalMessage, isOldMessage: Boolean, ): Boolean</ID> <ID>TooManyFunctions:K9CoreResourceProvider.kt$K9CoreResourceProvider : CoreResourceProvider</ID> <ID>TooManyFunctions:K9NotificationActionCreator.kt$K9NotificationActionCreator : NotificationActionCreator</ID> Loading
config/detekt/detekt-baseline-legacy-storage.xml +0 −21 Original line number Diff line number Diff line Loading @@ -41,27 +41,6 @@ <ID>MagicNumber:MigrationTo84.kt$MigrationTo84$3</ID> <ID>MagicNumber:MigrationTo84.kt$MigrationTo84$4</ID> <ID>MagicNumber:MigrationTo84.kt$MigrationTo84$5</ID> <ID>MagicNumber:Migrations.kt$Migrations$62</ID> <ID>MagicNumber:Migrations.kt$Migrations$64</ID> <ID>MagicNumber:Migrations.kt$Migrations$65</ID> <ID>MagicNumber:Migrations.kt$Migrations$66</ID> <ID>MagicNumber:Migrations.kt$Migrations$67</ID> <ID>MagicNumber:Migrations.kt$Migrations$68</ID> <ID>MagicNumber:Migrations.kt$Migrations$69</ID> <ID>MagicNumber:Migrations.kt$Migrations$70</ID> <ID>MagicNumber:Migrations.kt$Migrations$71</ID> <ID>MagicNumber:Migrations.kt$Migrations$72</ID> <ID>MagicNumber:Migrations.kt$Migrations$73</ID> <ID>MagicNumber:Migrations.kt$Migrations$74</ID> <ID>MagicNumber:Migrations.kt$Migrations$75</ID> <ID>MagicNumber:Migrations.kt$Migrations$76</ID> <ID>MagicNumber:Migrations.kt$Migrations$78</ID> <ID>MagicNumber:Migrations.kt$Migrations$79</ID> <ID>MagicNumber:Migrations.kt$Migrations$80</ID> <ID>MagicNumber:Migrations.kt$Migrations$81</ID> <ID>MagicNumber:Migrations.kt$Migrations$82</ID> <ID>MagicNumber:Migrations.kt$Migrations$83</ID> <ID>MagicNumber:Migrations.kt$Migrations$84</ID> <ID>MagicNumber:RetrieveFolderOperations.kt$CursorFolderAccessor$10</ID> <ID>MagicNumber:RetrieveFolderOperations.kt$CursorFolderAccessor$11</ID> <ID>MagicNumber:RetrieveFolderOperations.kt$CursorFolderAccessor$12</ID> Loading
legacy/common/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt +2 −27 Original line number Diff line number Diff line Loading @@ -32,38 +32,13 @@ class K9NotificationStrategy( return false } val folder = message.folder if (folder != null) { when (folder.databaseId) { account.inboxFolderId -> { // Don't skip notifications if the Inbox folder is also configured as another special folder } account.trashFolderId -> { Timber.v("No notification: Message is in Trash folder") return false } account.draftsFolderId -> { Timber.v("No notification: Message is in Drafts folder") return false } account.spamFolderId -> { Timber.v("No notification: Message is in Spam folder") return false } account.sentFolderId -> { Timber.v("No notification: Message is in Sent folder") return false } } } if (isModeMismatch(account.folderDisplayMode, localFolder.displayClass)) { Timber.v("No notification: Message is in folder not being displayed") return false } if (isModeMismatch(account.folderNotifyNewMailMode, localFolder.notifyClass)) { Timber.v("No notification: Notifications are disabled for this folder class") if (!localFolder.isNotificationsEnabled) { Timber.v("No notification: Notifications are not enabled for this folder") return false } Loading
legacy/core/src/main/java/com/fsck/k9/mailstore/FolderSettingsProvider.kt +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ class FolderSettingsProvider(val preferences: Preferences, val account: Account) visibleLimit = account.displayCount, displayClass = storage.getString("$prefix.displayMode", null).toFolderClass(FolderClass.NO_CLASS), syncClass = storage.getString("$prefix.syncMode", null).toFolderClass(FolderClass.INHERITED), notifyClass = storage.getString("$prefix.notifyMode", null).toFolderClass(FolderClass.INHERITED), isNotificationsEnabled = storage.getBoolean("$prefix.notificationsEnabled", false), pushClass = storage.getString("$prefix.pushMode", null).toFolderClass(FolderClass.SECOND_CLASS), inTopGroup = storage.getBoolean("$prefix.inTopGroup", false), integrate = storage.getBoolean("$prefix.integrate", false), Loading @@ -31,7 +31,7 @@ class FolderSettingsProvider(val preferences: Preferences, val account: Account) editor.remove("$prefix.displayMode") editor.remove("$prefix.syncMode") editor.remove("$prefix.notifyMode") editor.remove("$prefix.notificationsEnabled") editor.remove("$prefix.pushMode") editor.remove("$prefix.inTopGroup") editor.remove("$prefix.integrate") Loading
legacy/core/src/main/java/com/fsck/k9/mailstore/LocalFolder.java +4 −10 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ public class LocalFolder { private FolderClass displayClass = FolderClass.NO_CLASS; private FolderClass syncClass = FolderClass.INHERITED; private FolderClass pushClass = FolderClass.SECOND_CLASS; private FolderClass notifyClass = FolderClass.INHERITED; private boolean notificationsEnabled = false; private boolean isInTopGroup = false; private boolean isIntegrate = false; Loading Loading @@ -177,8 +177,7 @@ public class LocalFolder { String noClass = FolderClass.NO_CLASS.toString(); String displayClass = cursor.getString(LocalStore.FOLDER_DISPLAY_CLASS_INDEX); this.displayClass = FolderClass.valueOf((displayClass == null) ? noClass : displayClass); String notifyClass = cursor.getString(LocalStore.FOLDER_NOTIFY_CLASS_INDEX); this.notifyClass = FolderClass.valueOf((notifyClass == null) ? noClass : notifyClass); this.notificationsEnabled = cursor.getInt(LocalStore.FOLDER_NOTIFICATIONS_ENABLED_INDEX) == 1; String pushClass = cursor.getString(LocalStore.FOLDER_PUSH_CLASS_INDEX); this.pushClass = FolderClass.valueOf((pushClass == null) ? noClass : pushClass); String syncClass = cursor.getString(LocalStore.FOLDER_SYNC_CLASS_INDEX); Loading Loading @@ -308,10 +307,6 @@ public class LocalFolder { return (FolderClass.INHERITED == syncClass) ? getDisplayClass() : syncClass; } public FolderClass getNotifyClass() { return (FolderClass.INHERITED == notifyClass) ? getPushClass() : notifyClass; } public FolderClass getPushClass() { return (FolderClass.INHERITED == pushClass) ? getSyncClass() : pushClass; } Loading @@ -331,9 +326,8 @@ public class LocalFolder { updateFolderColumn("push_class", this.pushClass.name()); } public void setNotifyClass(FolderClass notifyClass) throws MessagingException { this.notifyClass = notifyClass; updateFolderColumn("notify_class", this.notifyClass.name()); public boolean isNotificationsEnabled() { return notificationsEnabled; } public boolean isIntegrate() { Loading