chore: Use Coordinate instead of Nip19Coordinate in NostrClient::fetch_repo
Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
@@ -99,7 +99,7 @@ impl CommandRunner for NewArgs {
|
|||||||
utils::add_write_relays(options.relays.clone(), relays_list.as_ref());
|
utils::add_write_relays(options.relays.clone(), relays_list.as_ref());
|
||||||
client.add_relays(&options.relays).await;
|
client.add_relays(&options.relays).await;
|
||||||
client.add_relays(&self.naddr.relays).await;
|
client.add_relays(&self.naddr.relays).await;
|
||||||
write_relays.extend(client.fetch_repo(&self.naddr).await?.relays);
|
write_relays.extend(client.fetch_repo(&self.naddr.coordinate).await?.relays);
|
||||||
|
|
||||||
let (subject, content) = self.issue_content()?;
|
let (subject, content) = self.issue_content()?;
|
||||||
let tokens = NostrParser::new().parse(&content).collect::<Vec<_>>();
|
let tokens = NostrParser::new().parse(&content).collect::<Vec<_>>();
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ impl CommandRunner for ViewArgs {
|
|||||||
client.add_relays(&self.naddr.relays).await;
|
client.add_relays(&self.naddr.relays).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
let repo = client.fetch_repo(&self.naddr).await?;
|
let repo = client.fetch_repo(&self.naddr.coordinate).await?;
|
||||||
let mut msg = format!("ID: {}", repo.id);
|
let mut msg = format!("ID: {}", repo.id);
|
||||||
|
|
||||||
if let Some(name) = repo.name {
|
if let Some(name) = repo.name {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ use nostr::{
|
|||||||
event::{Event, EventId, Kind, UnsignedEvent},
|
event::{Event, EventId, Kind, UnsignedEvent},
|
||||||
filter::Filter,
|
filter::Filter,
|
||||||
key::{Keys, PublicKey},
|
key::{Keys, PublicKey},
|
||||||
nips::{nip19::Nip19Coordinate, nip34::GitRepositoryAnnouncement},
|
nips::{nip01::Coordinate, nip34::GitRepositoryAnnouncement},
|
||||||
types::RelayUrl,
|
types::RelayUrl,
|
||||||
};
|
};
|
||||||
use nostr_sdk::Client;
|
use nostr_sdk::Client;
|
||||||
@@ -124,7 +124,7 @@ impl NostrClient {
|
|||||||
/// Try to fetch a repository and returns it
|
/// Try to fetch a repository and returns it
|
||||||
pub async fn fetch_repo(
|
pub async fn fetch_repo(
|
||||||
&self,
|
&self,
|
||||||
repo_naddr: &Nip19Coordinate,
|
repo_naddr: &Coordinate,
|
||||||
) -> N34Result<GitRepositoryAnnouncement> {
|
) -> N34Result<GitRepositoryAnnouncement> {
|
||||||
let filter = Filter::new()
|
let filter = Filter::new()
|
||||||
.author(repo_naddr.public_key)
|
.author(repo_naddr.public_key)
|
||||||
|
|||||||
Reference in New Issue
Block a user