Repository: thunderbird/thunderbird-android
File: legacy/ui/legacy/src/main/java/com/fsck/k9/ui/messageview/MessageViewFragment.kt (Kotlin)

Code before:
        )
    }

    private fun onEditAsNewMessage() {
        val message = checkNotNull(this.message)

        fragmentListener.onEditAsNewMessage(message.makeMessageReference())
    }

    fun onMove() {
        check(messagingController.isMoveCapable(account))
        checkNotNull(message)

        if (!messagingController.isMoveCapable(messageReference)) {
            Toast.makeText(activity, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG).show()
            return
        }

        val input = ChooseFolderResultContract.Input(
            accountUuid = account.uuid,
            currentFolderId = messageReference.folderId,
            scrollToFolderId = account.lastSelectedFolderId,
            messageReference = messageReference,
        )

        chooseFolderToMoveLauncher.launch(input)
    }

    fun onCopy() {
        check(messagingController.isCopyCapable(account))
        checkNotNull(message)

        if (!messagingController.isCopyCapable(messageReference)) {
            Toast.makeText(activity, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG).show()
            return
        }

        val input = ChooseFolderResultContract.Input(
            accountUuid = account.uuid,
            currentFolderId = messageReference.folderId,
            scrollToFolderId = account.lastSelectedFolderId,
            messageReference = messageReference,
        )

        chooseFolderToCopyLauncher.launch(input)
    }

    private fun onMoveToDrafts() {
        fragmentListener.performNavigationAfterMessageRemoval()

        val account = account

Review comment (suggestion):
Optional: Since the `ChooseFolderResultContract.Input` properties are essentially arguments to `launch()`, I think it feels more natural to include the data class instantiation in the `launch()` statement.

```suggestion
        chooseFolderToMoveLauncher.launch(
            ChooseFolderResultContract.Input(
                accountUuid = account.uuid,
                currentFolderId = messageReference.folderId,
                scrollToFolderId = account.lastSelectedFolderId,
                messageReference = messageReference,
            ),
        )
```

Alternatively, we could create an extension function to hide `ChooseFolderResultContract.Input` from the caller:

```kotlin
fun ActivityResultLauncher<ChooseFolderResultContract.Input>.launch(
    accountUuid: String,
    currentFolderId: Long? = null,
    scrollToFolderId: Long? = null,
    messageReference: MessageReference? = null,
) {
    launch(input = ChooseFolderResultContract.Input(accountUuid, currentFolderId, scrollToFolderId, messageReference))
}
```

Code after:
            messageReference = message.makeMessageReference(),
            decryptionResultForReply = messageCryptoPresenter.decryptionResultForReply,
        )
    }

    private fun onEditAsNewMessage() {
        val message = checkNotNull(this.message)

        fragmentListener.onEditAsNewMessage(message.makeMessageReference())
    }

    fun onMove() {
        check(messagingController.isMoveCapable(account))
        checkNotNull(message)

        if (!messagingController.isMoveCapable(messageReference)) {
            Toast.makeText(activity, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG).show()
            return
        }

        chooseFolderForMoveLauncher.launch(
            input = ChooseFolderResultContract.Input(
                accountUuid = account.uuid,
                currentFolderId = messageReference.folderId,
                scrollToFolderId = account.lastSelectedFolderId,
                messageReference = messageReference,
            ),
        )
    }

    fun onCopy() {
        check(messagingController.isCopyCapable(account))
        checkNotNull(message)

        if (!messagingController.isCopyCapable(messageReference)) {
            Toast.makeText(activity, R.string.move_copy_cannot_copy_unsynced_message, Toast.LENGTH_LONG).show()
            return
        }

        chooseFolderForCopyLauncher.launch(
            input = ChooseFolderResultContract.Input(
                accountUuid = account.uuid,
                currentFolderId = messageReference.folderId,
                scrollToFolderId = account.lastSelectedFolderId,
                messageReference = messageReference,
            ),
        )
    }

    private fun onMoveToDrafts() {
        fragmentListener.performNavigationAfterMessageRemoval()