From 00cff358f31f41f1dd8a06774673fd181955972d Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 25 Apr 2024 22:14:58 +0200 Subject: [PATCH] Rename `ImapFolder.setFlags()` to `setFlagsForAllMessages()` --- .../main/java/com/fsck/k9/backend/imap/CommandDeleteAll.kt | 2 +- .../java/com/fsck/k9/backend/imap/CommandMarkAllAsRead.kt | 2 +- .../src/test/java/com/fsck/k9/backend/imap/TestImapFolder.kt | 2 +- .../src/main/java/com/fsck/k9/mail/store/imap/ImapFolder.kt | 2 +- .../main/java/com/fsck/k9/mail/store/imap/RealImapFolder.kt | 2 +- .../java/com/fsck/k9/mail/store/imap/RealImapFolderTest.kt | 4 ++-- .../test/java/com/fsck/k9/mail/store/imap/TestImapFolder.kt | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/imap/src/main/java/com/fsck/k9/backend/imap/CommandDeleteAll.kt b/backend/imap/src/main/java/com/fsck/k9/backend/imap/CommandDeleteAll.kt index b4572984c..23a307217 100644 --- a/backend/imap/src/main/java/com/fsck/k9/backend/imap/CommandDeleteAll.kt +++ b/backend/imap/src/main/java/com/fsck/k9/backend/imap/CommandDeleteAll.kt @@ -13,7 +13,7 @@ internal class CommandDeleteAll(private val imapStore: ImapStore) { try { remoteFolder.open(OpenMode.READ_WRITE) - remoteFolder.setFlags(setOf(Flag.DELETED), true) + remoteFolder.setFlagsForAllMessages(setOf(Flag.DELETED), true) } finally { remoteFolder.close() } diff --git a/backend/imap/src/main/java/com/fsck/k9/backend/imap/CommandMarkAllAsRead.kt b/backend/imap/src/main/java/com/fsck/k9/backend/imap/CommandMarkAllAsRead.kt index 88d40ca87..ca99a7fec 100644 --- a/backend/imap/src/main/java/com/fsck/k9/backend/imap/CommandMarkAllAsRead.kt +++ b/backend/imap/src/main/java/com/fsck/k9/backend/imap/CommandMarkAllAsRead.kt @@ -12,7 +12,7 @@ internal class CommandMarkAllAsRead(private val imapStore: ImapStore) { remoteFolder.open(OpenMode.READ_WRITE) if (remoteFolder.mode != OpenMode.READ_WRITE) return - remoteFolder.setFlags(setOf(Flag.SEEN), true) + remoteFolder.setFlagsForAllMessages(setOf(Flag.SEEN), true) } finally { remoteFolder.close() } diff --git a/backend/imap/src/test/java/com/fsck/k9/backend/imap/TestImapFolder.kt b/backend/imap/src/test/java/com/fsck/k9/backend/imap/TestImapFolder.kt index 306fb43f3..13fefe9f4 100644 --- a/backend/imap/src/test/java/com/fsck/k9/backend/imap/TestImapFolder.kt +++ b/backend/imap/src/test/java/com/fsck/k9/backend/imap/TestImapFolder.kt @@ -139,7 +139,7 @@ open class TestImapFolder(override val serverId: String) : ImapFolder { throw UnsupportedOperationException("not implemented") } - override fun setFlags(flags: Set, value: Boolean) { + override fun setFlagsForAllMessages(flags: Set, value: Boolean) { if (value) { for (messageFlagSet in messageFlags.values) { messageFlagSet.addAll(flags) diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapFolder.kt b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapFolder.kt index 1e2195a80..2706c16d8 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapFolder.kt +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapFolder.kt @@ -70,7 +70,7 @@ interface ImapFolder { fun appendMessages(messages: List): Map? @Throws(MessagingException::class) - fun setFlags(flags: Set, value: Boolean) + fun setFlagsForAllMessages(flags: Set, value: Boolean) @Throws(MessagingException::class) fun setFlags(messages: List, flags: Set, value: Boolean) diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolder.kt b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolder.kt index c1b75e1fe..4eca45c85 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolder.kt +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/RealImapFolder.kt @@ -1109,7 +1109,7 @@ internal class RealImapFolder( } @Throws(MessagingException::class) - override fun setFlags(flags: Set, value: Boolean) { + override fun setFlagsForAllMessages(flags: Set, value: Boolean) { open(OpenMode.READ_WRITE) checkOpen() diff --git a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderTest.kt b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderTest.kt index 80468e84f..cb5805a4d 100644 --- a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderTest.kt +++ b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapFolderTest.kt @@ -1136,11 +1136,11 @@ class RealImapFolderTest { } @Test - fun setFlags_shouldIssueUidStoreCommand() { + fun setFlagsForAllMessages_shouldIssueUidStoreCommand() { val folder = createFolder("Folder") prepareImapFolderForOpen(OpenMode.READ_WRITE) - folder.setFlags(setOf(Flag.SEEN), true) + folder.setFlagsForAllMessages(setOf(Flag.SEEN), true) assertCommandIssued("UID STORE 1:* +FLAGS.SILENT (\\Seen)") } diff --git a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/TestImapFolder.kt b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/TestImapFolder.kt index 12e96f6ad..f922d8ae9 100644 --- a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/TestImapFolder.kt +++ b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/TestImapFolder.kt @@ -96,7 +96,7 @@ internal open class TestImapFolder( throw UnsupportedOperationException("not implemented") } - override fun setFlags(flags: Set, value: Boolean) { + override fun setFlagsForAllMessages(flags: Set, value: Boolean) { throw UnsupportedOperationException("not implemented") }