diff --git a/gossip-lib/src/overlord/mod.rs b/gossip-lib/src/overlord/mod.rs index 2bc4a1bfb..43bac9d2e 100644 --- a/gossip-lib/src/overlord/mod.rs +++ b/gossip-lib/src/overlord/mod.rs @@ -11,8 +11,8 @@ use crate::people::Person; use crate::person_relay::PersonRelay; use crate::relay::Relay; use crate::tags::{ - add_addr_to_tags, add_event_parent_to_tags, add_event_to_tags, add_pubkey_hex_to_tags, - add_pubkey_to_tags, add_subject_to_tags_if_missing, + add_addr_to_tags, add_event_to_tags, add_pubkey_hex_to_tags, add_pubkey_to_tags, + add_subject_to_tags_if_missing, }; use gossip_relay_picker::{Direction, RelayAssignment}; use http::StatusCode; @@ -1403,19 +1403,17 @@ impl Overlord { // Add an 'e' tag for the root add_event_to_tags(&mut tags, root, "root").await; - // Add an 'e' and 'E' tag for the note we are replying to + // Add an 'e' tag for the note we are replying to add_event_to_tags(&mut tags, parent_id, "reply").await; - add_event_parent_to_tags(&mut tags, parent_id).await; } else { let ancestors = parent.referred_events(); if ancestors.is_empty() { // parent is the root add_event_to_tags(&mut tags, parent_id, "root").await; } else { - // Add an 'e' and 'E' tag for the note we are replying to + // Add an 'e' tag for the note we are replying to // (and we don't know about the root, the parent is malformed). add_event_to_tags(&mut tags, parent_id, "reply").await; - add_event_parent_to_tags(&mut tags, parent_id).await; } } diff --git a/gossip-lib/src/tags.rs b/gossip-lib/src/tags.rs index 4adf71108..5dd2696b1 100644 --- a/gossip-lib/src/tags.rs +++ b/gossip-lib/src/tags.rs @@ -28,31 +28,6 @@ pub async fn add_pubkey_to_tags(existing_tags: &mut Vec, added: &PublicKey) add_pubkey_hex_to_tags(existing_tags, &added.as_hex_string().into()).await } -pub async fn add_event_parent_to_tags(existing_tags: &mut Vec, added: Id) -> usize { - let newtag = Tag::EventParent { - id: added, - recommended_relay_url: Relay::recommended_relay_for_reply(added) - .await - .ok() - .flatten() - .map(|rr| rr.to_unchecked_url()), - trailing: Vec::new(), - }; - - match existing_tags.iter().position(|existing_tag| { - matches!( - existing_tag, - Tag::EventParent { id: existing_e, .. } if existing_e.0 == added.0 - ) - }) { - None => { - existing_tags.push(newtag); - existing_tags.len() - 1 - } - Some(idx) => idx, - } -} - pub async fn add_event_to_tags(existing_tags: &mut Vec, added: Id, marker: &str) -> usize { let newtag = Tag::Event { id: added,