Repository: thundernest/k-9
Issue: more than 8 new messages always says there are only 8 new messages in notification

### 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.511

### Where did you get the app from?

Google Play

### Android version

12

### Device model

Samsung Galaxy Tab S6

### Steps to reproduce

Receive more than 8 new messages

### Expected behavior

The message count in the notification should tell you how many new messages you actually have, even if there are only 8 of them displayed in the notification.

I know this is possible to do because Twitter does it. There will only be 8 of them actually displayed, but the count at the top shows 15 or 20, etc.

### Actual behavior

K9 only shows 8 messages in the notification, which is fine, except that it also tells you that there are only 8, even though there are actually more. When you swipe them away or otherwise deal with them, additional message notifications appear to fill up the space freed up by the one you actioned. If it told you how many were actually there then you would know to expect the new ones to fill in as you deal with them.

### Logs

_No response_

Changed files:
app/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt, app/core/src/main/java/com/fsck/k9/notification/NotificationDataStore.kt

diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationDataStore.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationDataStore.kt
index b9f63f3bb..f3e80d344 100644
--- a/app/core/src/main/java/com/fsck/k9/notification/NotificationDataStore.kt
+++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationDataStore.kt
@@ -3,7 +3,7 @@ package com.fsck.k9.notification
 import com.fsck.k9.Account
 import com.fsck.k9.controller.MessageReference
 
-internal const val MAX_NUMBER_OF_NEW_MESSAGE_NOTIFICATIONS = 8
+internal const val MAX_NUMBER_OF_NEW_MESSAGE_NOTIFICATIONS = 9
 
 /**
  * Stores information about new message notifications for all accounts.
diff --git a/app/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt b/app/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt
index 3e1d869b0..781acaf65 100644
--- a/app/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt
+++ b/app/core/src/test/java/com/fsck/k9/notification/NotificationDataStoreTest.kt
@@ -52,8 +52,9 @@ class NotificationDataStoreTest : RobolectricTest() {
         notificationDataStore.addNotification(account, createNotificationContent("6"), TIMESTAMP)
         notificationDataStore.addNotification(account, createNotificationContent("7"), TIMESTAMP)
         notificationDataStore.addNotification(account, createNotificationContent("8"), TIMESTAMP)
+        notificationDataStore.addNotification(account, createNotificationContent("9"), TIMESTAMP)
 
-        val result = notificationDataStore.addNotification(account, createNotificationContent("9"), TIMESTAMP)
+        val result = notificationDataStore.addNotification(account, createNotificationContent("10"), TIMESTAMP)
 
         assertNotNull(result)
         assertThat(result.shouldCancelNotification).isTrue()
@@ -86,7 +87,8 @@ class NotificationDataStoreTest : RobolectricTest() {
         notificationDataStore.addNotification(account, createNotificationContent("7"), TIMESTAMP)
         notificationDataStore.addNotification(account, createNotificationContent("8"), TIMESTAMP)
         notificationDataStore.addNotification(account, createNotificationContent("9"), TIMESTAMP)
-        val latestContent = createNotificationContent("10")
+        notificationDataStore.addNotification(account, createNotificationContent("10"), TIMESTAMP)
+        val latestContent = createNotificationContent("11")
         notificationDataStore.addNotification(account, latestContent, TIMESTAMP)
 
         val result = notificationDataStore.removeNotifications(account) { listOf(latestContent.messageReference) }
@@ -207,7 +209,8 @@ class NotificationDataStoreTest : RobolectricTest() {
         notificationDataStore.addNotification(account, createNotificationContent("6"), TIMESTAMP)
         notificationDataStore.addNotification(account, createNotificationContent("7"), TIMESTAMP)
         notificationDataStore.addNotification(account, createNotificationContent("8"), TIMESTAMP)
-        val latestNotificationContent = createNotificationContent("9")
+        notificationDataStore.addNotification(account, createNotificationContent("9"), TIMESTAMP)
+        val latestNotificationContent = createNotificationContent("10")
         notificationDataStore.addNotification(account, latestNotificationContent, TIMESTAMP)
         val content = createNotificationContent("1")