Repository: thunderbird/thunderbird-android (language: kotlin)

Issue:
"Sent” folder: Missing space between "To" and address
### Checklist

- [X] I have used the search function to see if someone else has already submitted the same bug report.
- [X] I will describe the problem with as much detail as possible.

### App version

6.804

### Where did you get the app from?

None

### Android version

GrapheneOS

### Device model

_No response_

### Steps to reproduce

Imo not necessary.

### Expected behavior

Space.

### Actual behavior

Missing space.

![Screenshot 2024-09-25 143623 - ss](https://github.com/user-attachments/assets/c4cb1785-2874-47e0-9e06-4155072c7330)


### Logs

_No response_


Discussion hints:
Thanks for reporting, can confirm. This should be a super easy fix if all goes well, would you be interested in looking into it?
Hey! 

I'm interested in contributing to this issue.

I already found a solution but I don't if a good way to solve it.

I changed the `getRecipientDisplayNames` in `MessageHelper.kt` in line 37 to append a whitespace before append the recipients list.

Also I saw that you don't have unit tests for this method, if you agree I can write some

Hope to get your feedback.

Thanks!
@alvar0liveira I'm excited you're ready to contribute! Why don't you go ahead and send a pull request with what you have? The team will take a look and review. Unit tests would be great!

Pull request: Fix "Sent” folder: Missing space between "To" and address
Hey!

This PR Fixes #8170. 

The issue reported has a missing space between the label "To:" and contact information.

I added the space and some unit tests to test the behavior of `MessageHelper.kt`.

See 
![Fix8170](https://github.com/user-attachments/assets/05093074-8357-499b-8067-0dffe3c22b26)


Looking forward to hearing your feedback!

Thanks,
Álvaro


Test command: ./gradlew :legacy:core:testDebugUnitTest --tests "com.fsck.k9.helper.MessageHelperTest"

Fix patch:
diff --git a/legacy/core/src/main/java/com/fsck/k9/helper/MessageHelper.kt b/legacy/core/src/main/java/com/fsck/k9/helper/MessageHelper.kt
index a36dc77909d..b33eaec36d5 100644
--- a/legacy/core/src/main/java/com/fsck/k9/helper/MessageHelper.kt
+++ b/legacy/core/src/main/java/com/fsck/k9/helper/MessageHelper.kt
@@ -34,7 +34,7 @@ class MessageHelper(
         }
         val repository = if (isShowContactName) contactRepository else null
         val recipients = toFriendly(addresses, repository)
-        return SpannableStringBuilder(resourceProvider.contactDisplayNamePrefix()).append(recipients)
+        return SpannableStringBuilder(resourceProvider.contactDisplayNamePrefix()).append(' ').append(recipients)
     }
 
     companion object {


Test patch:
diff --git a/legacy/core/src/test/java/com/fsck/k9/helper/MessageHelperTest.kt b/legacy/core/src/test/java/com/fsck/k9/helper/MessageHelperTest.kt
index fc7d3a982cf..c07fb629e72 100644
--- a/legacy/core/src/test/java/com/fsck/k9/helper/MessageHelperTest.kt
+++ b/legacy/core/src/test/java/com/fsck/k9/helper/MessageHelperTest.kt
@@ -10,6 +10,8 @@ import app.k9mail.core.common.mail.toEmailAddressOrThrow
 import assertk.assertThat
 import assertk.assertions.isEqualTo
 import assertk.assertions.isInstanceOf
+import com.fsck.k9.CoreResourceProvider
+import com.fsck.k9.TestCoreResourceProvider
 import com.fsck.k9.helper.MessageHelper.Companion.toFriendly
 import com.fsck.k9.mail.Address
 import org.junit.Test
@@ -20,6 +22,8 @@ import org.mockito.kotlin.stub
 class MessageHelperTest : RobolectricTest() {
 
     private val contactRepository: ContactRepository = mock()
+    private val resourceProvider: CoreResourceProvider = TestCoreResourceProvider()
+    private val messageHelper: MessageHelper = MessageHelper(resourceProvider, contactRepository)
 
     @Test
     fun testToFriendlyShowsPersonalPartIfItExists() {
@@ -116,6 +120,32 @@ class MessageHelperTest : RobolectricTest() {
         assertThat(friendly).isEqualTo("Tim@Testor")
     }
 
+    @Test
+    fun testGetSenderDisplayNameWithShowContactNameShouldReturnCorrectOutput() {
+        val address1 = Address("test@testor.com", "Tim Testor")
+        val address2 = Address("foo@bar.com", "Foo Bar")
+        val addresses = arrayOf(address1, address2)
+        setupContactRepositoryWithFakeContact(EMAIL_ADDRESS)
+        val displayName = messageHelper.getRecipientDisplayNames(addresses)
+        assertThat(displayName.toString()).isEqualTo("To: Tim Testor,Foo Bar")
+    }
+
+    @Test
+    fun testGetSenderDisplayNameWithoutShowContactNameShouldReturnCorrectOutput() {
+        val address1 = Address("test@testor.com")
+        val address2 = Address("foo@bar.com")
+        val addresses = arrayOf(address1, address2)
+
+        val displayName = messageHelper.getRecipientDisplayNames(addresses)
+        assertThat(displayName.toString()).isEqualTo("To: test@testor.com,foo@bar.com")
+    }
+
+    @Test
+    fun testGetSenderDisplayNameWithoutInputReturnCorrectOutput() {
+        val displayName = messageHelper.getRecipientDisplayNames(null)
+        assertThat(displayName.toString()).isEqualTo(resourceProvider.contactUnknownRecipient())
+    }
+
     private fun setupContactRepositoryWithFakeContact(emailAddress: EmailAddress) {
         contactRepository.stub {
             on { getContactFor(emailAddress) } doReturn