From 78e77c43521c63c504d3e71f29ea9c1deed6ec95 Mon Sep 17 00:00:00 2001 From: reya Date: Fri, 8 Nov 2024 15:02:54 +0700 Subject: [PATCH] nostr: add `Kind::Comment` Signed-off-by: Yuki Kishimoto --- CHANGELOG.md | 1 + bindings/nostr-sdk-ffi/src/protocol/event/kind.rs | 4 ++++ crates/nostr/src/event/kind.rs | 1 + 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f375c6e62..ee7678b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ ### Added * nostr: add `SingleLetterTag::as_str` and `TagKind::as_str` ([Yuki Kishimoto]) +* nostr: add `Kind::Comment` ([reyamir]) ### Fixed diff --git a/bindings/nostr-sdk-ffi/src/protocol/event/kind.rs b/bindings/nostr-sdk-ffi/src/protocol/event/kind.rs index 8e7588e4b..2d5d3884e 100644 --- a/bindings/nostr-sdk-ffi/src/protocol/event/kind.rs +++ b/bindings/nostr-sdk-ffi/src/protocol/event/kind.rs @@ -135,6 +135,8 @@ pub enum KindEnum { Repost, /// Generic Repost (NIP18) GenericRepost, + /// Comment (NIP22) + Comment, /// Reaction (NIP25) Reaction, /// Badge Award (NIP58) @@ -352,6 +354,7 @@ impl From for KindEnum { nostr::Kind::EventDeletion => Self::EventDeletion, nostr::Kind::Repost => Self::Repost, nostr::Kind::GenericRepost => Self::GenericRepost, + nostr::Kind::Comment => Self::Comment, nostr::Kind::Reaction => Self::Reaction, nostr::Kind::BadgeAward => Self::BadgeAward, nostr::Kind::ChannelCreation => Self::ChannelCreation, @@ -438,6 +441,7 @@ impl From for nostr::Kind { KindEnum::EventDeletion => Self::EventDeletion, KindEnum::Repost => Self::Repost, KindEnum::GenericRepost => Self::GenericRepost, + KindEnum::Comment => Self::Comment, KindEnum::Reaction => Self::Reaction, KindEnum::BadgeAward => Self::BadgeAward, KindEnum::ChannelCreation => Self::ChannelCreation, diff --git a/crates/nostr/src/event/kind.rs b/crates/nostr/src/event/kind.rs index 18ff650ef..fcc1d00d3 100644 --- a/crates/nostr/src/event/kind.rs +++ b/crates/nostr/src/event/kind.rs @@ -100,6 +100,7 @@ kind_variants! { EventDeletion => 5, "Event Deletion (NIP09)", Repost => 6, "Repost (NIP18)", GenericRepost => 16, "Generic Repost (NIP18)", + Comment => 1111, "Comment (NIP22)", Reaction => 7, "Reaction (NIP25)", BadgeAward => 8, "Badge Award (NIP58)", ChannelCreation => 40, "Channel Creation (NIP28)",