chore(patch-fetch): Remove the repo coordinate from the filter
Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
@@ -24,7 +24,7 @@ use clap::Args;
|
|||||||
use nostr::{
|
use nostr::{
|
||||||
event::{Kind, TagKind},
|
event::{Kind, TagKind},
|
||||||
filter::Filter,
|
filter::Filter,
|
||||||
nips::{nip01::Coordinate, nip19::ToBech32},
|
nips::nip19::ToBech32,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@@ -98,17 +98,7 @@ impl CommandRunner for FetchArgs {
|
|||||||
{
|
{
|
||||||
return Err(N34Error::NotRootPatch);
|
return Err(N34Error::NotRootPatch);
|
||||||
}
|
}
|
||||||
let root_first_coordinate = Coordinate::parse(
|
|
||||||
root_patch
|
|
||||||
.tags
|
|
||||||
.find(TagKind::a())
|
|
||||||
.and_then(|t| t.content())
|
|
||||||
.ok_or(N34Error::InvalidEvent(
|
|
||||||
"The patch does not contain the tag `a` coordinate of the repository"
|
|
||||||
.to_owned(),
|
|
||||||
))?,
|
|
||||||
)
|
|
||||||
.map_err(|err| N34Error::InvalidEvent(err.to_string()))?;
|
|
||||||
let root_author = root_patch.pubkey;
|
let root_author = root_patch.pubkey;
|
||||||
let root_patch = super::GitPatch::from_str(&root_patch.content)
|
let root_patch = super::GitPatch::from_str(&root_patch.content)
|
||||||
.map_err(|err| N34Error::InvalidEvent(format!("Failed to parse the patch: {err}")))?;
|
.map_err(|err| N34Error::InvalidEvent(format!("Failed to parse the patch: {err}")))?;
|
||||||
@@ -116,13 +106,7 @@ impl CommandRunner for FetchArgs {
|
|||||||
tracing::info!("Found the root patch: `{}`", root_patch.subject);
|
tracing::info!("Found the root patch: `{}`", root_patch.subject);
|
||||||
|
|
||||||
let mut patches = client
|
let mut patches = client
|
||||||
.fetch_events(
|
.fetch_patch_series(self.patch_id.event_id, root_author)
|
||||||
Filter::new()
|
|
||||||
.kind(Kind::GitPatch)
|
|
||||||
.author(root_author)
|
|
||||||
.event(self.patch_id.event_id)
|
|
||||||
.coordinate(&root_first_coordinate),
|
|
||||||
)
|
|
||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|p| {
|
.map(|p| {
|
||||||
|
|||||||
Reference in New Issue
Block a user