Skip to content

Commit

Permalink
nostr: don't use reply event as root e tag i no root is set in `Eve…
Browse files Browse the repository at this point in the history
…ntBuilder::text_note_reply`

Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
  • Loading branch information
yukibtc committed Dec 30, 2024
1 parent 4bf1228 commit 3e0e51c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
* nostr: require `fmt::Debug`, `Send` and `Sync` for `NostrSigner` ([Yuki Kishimoto])
* nostr: enable support for `Tags::indexes` in `no_std` ([Yuki Kishimoto])
* nostr: improve `RelayMessage` docs ([Yuki Kishimoto])
* nostr: include public key of root and parent author in `EventBuilder::comment` ([Yuki Kishimoto])
* nostr: dedup tags in `EventBuilder::text_note_reply` and `EventBuilder::comment` ([Yuki Kishimoto])
* nostr: don't use reply event as root `e` tag i no root is set in `EventBuilder::text_note_reply` ([Yuki Kishimoto])
* database: add manual trait implementations for `BTreeCappedSet` ([Yuki Kishimoto])
* database: replace LRU with custom memory cache for IDs tracking ([Yuki Kishimoto])
* lmdb: use `async-utility` to spawn blocking tasks ([Yuki Kishimoto])
Expand Down
2 changes: 0 additions & 2 deletions bindings/nostr-sdk-ffi/src/protocol/event/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ impl EventBuilder {

/// Text note reply
///
/// If no `root` is passed, the `reply_to` will be used for root `e` tag.
///
/// <https://github.com/nostr-protocol/nips/blob/master/10.md>
#[uniffi::constructor(default(root = None, relay_url = None))]
pub fn text_note_reply(
Expand Down
2 changes: 0 additions & 2 deletions bindings/nostr-sdk-js/src/protocol/event/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ impl JsEventBuilder {

/// Text note reply
///
/// If no `root` is passed, the `reply_to` will be used for root `e` tag.
///
/// <https://github.com/nostr-protocol/nips/blob/master/10.md>
#[wasm_bindgen(js_name = textNoteReply)]
pub fn text_note_reply(
Expand Down
5 changes: 1 addition & 4 deletions crates/nostr/src/event/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,6 @@ impl EventBuilder {

/// Text note reply
///
/// If no `root` is passed, the `reply_to` will be used for root `e` tag.
///
/// <https://github.com/nostr-protocol/nips/blob/master/10.md>
pub fn text_note_reply<S>(
content: S,
Expand Down Expand Up @@ -443,11 +441,10 @@ impl EventBuilder {
);
}
None => {
// No root event is passed, use `reply_to` event ID for `root` marker
tags.push(Tag::from_standardized_without_cell(TagStandard::Event {
event_id: reply_to.id,
relay_url,
marker: Some(Marker::Root),
marker: Some(Marker::Reply),
public_key: Some(reply_to.pubkey),
uppercase: false,
}));
Expand Down

0 comments on commit 3e0e51c

Please sign in to comment.