diff options
| author | Your Name <you@example.com> | 2026-05-27 15:32:38 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-27 15:32:38 +0530 |
| commit | d889b890f9e63815c178853ed98a1e31f6cec7f8 (patch) | |
| tree | 3eda17e8edaf61cc6dba640ae12a24e90c9d8b8c /src/git_mirror.rs | |
| parent | d60fa03de6edae0667a93ac36be4206e76255a2c (diff) | |
Fix compile issues for NIP-46 build
- nip46.rs: match on owned RelayPoolNotification (not .as_ref())
- git_mirror.rs: accept shared nostr_sdk::Client for state event publishing
- main.rs: pass nostr_client to mirror_repo_to_servers
- NIP46-PLAN.md: full implementation checklist and roadmap
- PLAN.md: updated
Diffstat (limited to 'src/git_mirror.rs')
| -rw-r--r-- | src/git_mirror.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/git_mirror.rs b/src/git_mirror.rs index c486887..cdf853e 100644 --- a/src/git_mirror.rs +++ b/src/git_mirror.rs | |||
| @@ -31,6 +31,7 @@ impl GitMirror { | |||
| 31 | repo: &DiscoveredRepo, | 31 | repo: &DiscoveredRepo, |
| 32 | target_servers: &[GraspServer], | 32 | target_servers: &[GraspServer], |
| 33 | nip46_client: Option<&Arc<Nip46Client>>, | 33 | nip46_client: Option<&Arc<Nip46Client>>, |
| 34 | nostr_client: &nostr_sdk::Client, | ||
| 34 | ) -> Result<()> { | 35 | ) -> Result<()> { |
| 35 | if target_servers.is_empty() { | 36 | if target_servers.is_empty() { |
| 36 | tracing::debug!( | 37 | tracing::debug!( |
| @@ -80,17 +81,6 @@ impl GitMirror { | |||
| 80 | let relay_url = server.relay_url(); | 81 | let relay_url = server.relay_url(); |
| 81 | if let Ok(url) = RelayUrl::parse(&relay_url) { | 82 | if let Ok(url) = RelayUrl::parse(&relay_url) { |
| 82 | let urls = vec![url]; | 83 | let urls = vec![url]; |
| 83 | if let Err(e) = nip46_client | ||
| 84 | .map_or(Ok(()), |_| { | ||
| 85 | Err(anyhow::anyhow!("need nostr client to send state event")) | ||
| 86 | }) | ||
| 87 | { | ||
| 88 | let _ = e; | ||
| 89 | } | ||
| 90 | |||
| 91 | let nostr_client = nostr_sdk::Client::default(); | ||
| 92 | let _ = nostr_client.add_relay(&relay_url).await; | ||
| 93 | nostr_client.connect().await; | ||
| 94 | if let Err(e) = nostr_client.send_event_to(urls, event.clone()).await { | 84 | if let Err(e) = nostr_client.send_event_to(urls, event.clone()).await { |
| 95 | tracing::warn!( | 85 | tracing::warn!( |
| 96 | server = %server.domain, | 86 | server = %server.domain, |