From d15f09c7a2a29b937c7d1f30f46578acb6789e48 Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Sat, 27 Jun 2026 10:19:08 +0700 Subject: [PATCH] ensure id --- shared/src/commonMain/kotlin/su/reya/coop/Nostr.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/src/commonMain/kotlin/su/reya/coop/Nostr.kt b/shared/src/commonMain/kotlin/su/reya/coop/Nostr.kt index ba0fcce..d5427a0 100644 --- a/shared/src/commonMain/kotlin/su/reya/coop/Nostr.kt +++ b/shared/src/commonMain/kotlin/su/reya/coop/Nostr.kt @@ -473,7 +473,7 @@ class Nostr { // Decrypt the rumor val rumor = signer.nip44DecryptAsync(sealEvent.author(), sealEvent.content()) - val unsignedEvent = UnsignedEvent.fromJson(rumor) + val unsignedEvent = UnsignedEvent.fromJson(rumor).ensureId() // Ensure the rumor author matches the seal if (unsignedEvent.author() != sealEvent.author()) { @@ -813,7 +813,7 @@ class Nostr { // Merge the events return events ?.toVec() - ?.map { UnsignedEvent.fromJson(it.content()) } + ?.map { UnsignedEvent.fromJson(it.content()).ensureId() } // Filter out events without public keys (receivers) ?.filter { it.tags().publicKeys().isNotEmpty() } ?.sortedByDescending { it.createdAt().asSecs() } ?: emptyList()