upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/lib/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/client.rs')
-rw-r--r--src/lib/client.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs
index 62db8d2..1f46e3c 100644
--- a/src/lib/client.rs
+++ b/src/lib/client.rs
@@ -2505,6 +2505,30 @@ pub async fn fetching_quietly(
2505 Ok((report, had_errors)) 2505 Ok((report, had_errors))
2506} 2506}
2507 2507
2508pub async fn get_issues_from_cache(
2509 git_repo_path: &Path,
2510 repo_coordinates: HashSet<Nip19Coordinate>,
2511) -> Result<Vec<nostr::Event>> {
2512 let mut issues = get_events_from_local_cache(
2513 git_repo_path,
2514 vec![
2515 nostr::Filter::default()
2516 .kinds([nostr::Kind::GitIssue])
2517 .custom_tags(
2518 nostr::SingleLetterTag::lowercase(nostr_sdk::Alphabet::A),
2519 repo_coordinates
2520 .iter()
2521 .map(|c| c.coordinate.to_string())
2522 .collect::<Vec<String>>(),
2523 ),
2524 ],
2525 )
2526 .await?;
2527 issues.sort_by_key(|e| e.created_at);
2528 issues.reverse();
2529 Ok(issues)
2530}
2531
2508pub async fn get_proposals_and_revisions_from_cache( 2532pub async fn get_proposals_and_revisions_from_cache(
2509 git_repo_path: &Path, 2533 git_repo_path: &Path,
2510 repo_coordinates: HashSet<Nip19Coordinate>, 2534 repo_coordinates: HashSet<Nip19Coordinate>,