Fixes mark as read when drafts are the latest message in the chat

This commit is contained in:
Vitor Pamplona
2025-09-12 11:37:58 -04:00
parent 0886af4386
commit bc10d7184f

View File

@@ -1084,6 +1084,13 @@ class AccountViewModel(
account.markAsRead("Channel/${noteEvent.channelId()}", noteEvent.createdAt)
} else if (noteEvent is ChatroomKeyable) {
account.markAsRead("Room/${noteEvent.chatroomKey(account.signer.pubKey).hashCode()}", noteEvent.createdAt)
} else if (noteEvent is DraftWrapEvent) {
val innerEvent = account.draftsDecryptionCache.preCachedDraft(noteEvent)
if (innerEvent is IsInPublicChatChannel) {
account.markAsRead("Channel/${innerEvent.channelId()}", noteEvent.createdAt)
} else if (innerEvent is ChatroomKeyable) {
account.markAsRead("Room/${innerEvent.chatroomKey(account.signer.pubKey).hashCode()}", noteEvent.createdAt)
}
}
}
}