From cdfecf2ee02ce239b6547b476dad3fb3ac3c02c2 Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Mon, 20 Jul 2026 13:27:16 +0700 Subject: [PATCH] skip send notification for self message --- shared/src/commonMain/kotlin/su/reya/coop/nostr/Nostr.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/src/commonMain/kotlin/su/reya/coop/nostr/Nostr.kt b/shared/src/commonMain/kotlin/su/reya/coop/nostr/Nostr.kt index 2580334..ce06e65 100644 --- a/shared/src/commonMain/kotlin/su/reya/coop/nostr/Nostr.kt +++ b/shared/src/commonMain/kotlin/su/reya/coop/nostr/Nostr.kt @@ -154,7 +154,10 @@ class Nostr( // Trigger new message notification if (rumor != null) { - if (rumor.createdAt().asSecs() >= now.asSecs()) { + val isSelfMessage = rumor.author() == signer.publicKeyFlow.value + val isNew = rumor.createdAt().asSecs() >= now.asSecs() + + if (isNew && !isSelfMessage) { onNewMessage(rumor) } }