From 9331669aea32e4fd878473243c7bf72fa8e3e821 Mon Sep 17 00:00:00 2001 From: Kgothatso Ngako Date: Sun, 12 Jul 2026 20:54:08 +0200 Subject: [PATCH] Save marmotGroupEvent --- .../compose/database/dao/MarmotOutboundDao.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/composeApp/src/commonMain/kotlin/at/torch/compose/database/dao/MarmotOutboundDao.kt b/composeApp/src/commonMain/kotlin/at/torch/compose/database/dao/MarmotOutboundDao.kt index 380c9938..797e3664 100644 --- a/composeApp/src/commonMain/kotlin/at/torch/compose/database/dao/MarmotOutboundDao.kt +++ b/composeApp/src/commonMain/kotlin/at/torch/compose/database/dao/MarmotOutboundDao.kt @@ -234,6 +234,19 @@ abstract class MarmotOutboundDao( ) ) + database.marmotGroupEventDao().upsert( + MarmotGroupEvent( + id = commitEvent.id, + createdAt = Instant.fromEpochSeconds(commitEvent.createdAt), + encryptedContent = commitEvent.encryptedContent(), + publicKey = commitEvent.pubKey, + userPublicKey = userPublicKey, + expiresAt = commitEvent.expiration()?.let { Instant.fromEpochSeconds(it) }, + chatRoomId = nostrGroupId, + signature = commitEvent.sig + ) + ) + // Save commitResult... in case we need to broadcast welcomeEvent after relay acknowledgement... database.marmotCommitResultDao().upsert( MarmotCommitResult( @@ -260,6 +273,7 @@ abstract class MarmotOutboundDao( ) } ) + // TODO: Save chatMessage } }