refactor(notifications): share markConversationRead helper across receivers

Extract the 'clear unread count + cancel message notification' pair into
a single suspend helper on MeshServiceNotifications so ReplyReceiver,
MarkAsReadReceiver, and ReactionReceiver use one consistent code path.
ReactionReceiver now also clears unread and cancels the notification
once the reaction dispatch succeeds, matching the other receivers.
Receivers that only depended on PacketRepository for this pair drop
that injection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
James Rich 2026-04-17 09:42:44 -05:00
parent 9c75f5a3f4
commit 6d70d154e6
8 changed files with 26 additions and 12 deletions

View file

@ -67,6 +67,13 @@ interface MeshServiceNotifications {
fun cancelMessageNotification(contactKey: String)
/**
* Marks the conversation for [contactKey] as read: clears its unread count in the packet repository and cancels the
* posted message notification (and the group summary). Intended for use by notification action receivers (reply,
* mark-as-read, reaction) to keep behavior consistent.
*/
suspend fun markConversationRead(contactKey: String)
fun cancelLowBatteryNotification(node: Node)
fun clearClientNotification(notification: ClientNotification)