Skip to content

Commit

Permalink
Merge pull request #8833 from wmontwe/change-backend-pop3-to-kotlin
Browse files Browse the repository at this point in the history
Change POP3 backend to Kotlin
  • Loading branch information
wmontwe authored Feb 18, 2025
2 parents d23d40a + 3b67029 commit 65f1bbf
Show file tree
Hide file tree
Showing 5 changed files with 695 additions and 640 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.fsck.k9.backend.pop3

import com.fsck.k9.mail.Flag
import com.fsck.k9.mail.MessagingException
import com.fsck.k9.mail.store.pop3.Pop3Store

internal class CommandSetFlag(private val pop3Store: Pop3Store) {

@Throws(MessagingException::class)
fun setFlag(
folderServerId: String,
messageServerIds: List<String>,
flag: Flag,
newState: Boolean,
) {
val folder = pop3Store.getFolder(folderServerId)
if (!folder.isFlagSupported(flag)) {
return
}

try {
folder.open()

val messages = messageServerIds.map { folder.getMessage(it) }
if (messages.isEmpty()) {
return
}

folder.setFlags(messages, setOf(flag), newState)
} finally {
folder.close()
}
}
}
Loading

0 comments on commit 65f1bbf

Please sign in to comment.