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.rs37
1 files changed, 30 insertions, 7 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs
index ae3b414..1f3b08c 100644
--- a/src/lib/client.rs
+++ b/src/lib/client.rs
@@ -1811,7 +1811,7 @@ pub async fn get_proposals_and_revisions_from_cache(
1811 git_repo_path, 1811 git_repo_path,
1812 vec![ 1812 vec![
1813 nostr::Filter::default() 1813 nostr::Filter::default()
1814 .kind(nostr::Kind::GitPatch) 1814 .kinds([nostr::Kind::GitPatch, KIND_PULL_REQUEST])
1815 .custom_tags( 1815 .custom_tags(
1816 nostr::SingleLetterTag::lowercase(nostr_sdk::Alphabet::A), 1816 nostr::SingleLetterTag::lowercase(nostr_sdk::Alphabet::A),
1817 repo_coordinates 1817 repo_coordinates
@@ -1823,7 +1823,7 @@ pub async fn get_proposals_and_revisions_from_cache(
1823 ) 1823 )
1824 .await? 1824 .await?
1825 .iter() 1825 .iter()
1826 .filter(|e| event_is_patch_set_root(e)) 1826 .filter(|e| event_is_patch_set_root(e) || e.kind.eq(&KIND_PULL_REQUEST))
1827 .cloned() 1827 .cloned()
1828 .collect::<Vec<nostr::Event>>(); 1828 .collect::<Vec<nostr::Event>>();
1829 proposals.sort_by_key(|e| e.created_at); 1829 proposals.sort_by_key(|e| e.created_at);
@@ -1831,7 +1831,7 @@ pub async fn get_proposals_and_revisions_from_cache(
1831 Ok(proposals) 1831 Ok(proposals)
1832} 1832}
1833 1833
1834pub async fn get_all_proposal_patch_events_from_cache( 1834pub async fn get_all_proposal_patch_pr_pr_update_events_from_cache(
1835 git_repo_path: &Path, 1835 git_repo_path: &Path,
1836 repo_ref: &RepoRef, 1836 repo_ref: &RepoRef,
1837 proposal_id: &nostr::EventId, 1837 proposal_id: &nostr::EventId,
@@ -1840,10 +1840,21 @@ pub async fn get_all_proposal_patch_events_from_cache(
1840 git_repo_path, 1840 git_repo_path,
1841 vec![ 1841 vec![
1842 nostr::Filter::default() 1842 nostr::Filter::default()
1843 .kind(nostr::Kind::GitPatch) 1843 .kinds([
1844 nostr::Kind::GitPatch,
1845 KIND_PULL_REQUEST,
1846 KIND_PULL_REQUEST_UPDATE,
1847 ])
1844 .event(*proposal_id), 1848 .event(*proposal_id),
1845 nostr::Filter::default() 1849 nostr::Filter::default()
1846 .kind(nostr::Kind::GitPatch) 1850 .kinds([
1851 nostr::Kind::GitPatch,
1852 KIND_PULL_REQUEST,
1853 KIND_PULL_REQUEST_UPDATE,
1854 ])
1855 .custom_tag(SingleLetterTag::uppercase(Alphabet::E), *proposal_id),
1856 nostr::Filter::default()
1857 .kinds([nostr::Kind::GitPatch, KIND_PULL_REQUEST])
1847 .id(*proposal_id), 1858 .id(*proposal_id),
1848 ], 1859 ],
1849 ) 1860 )
@@ -1876,8 +1887,20 @@ pub async fn get_all_proposal_patch_events_from_cache(
1876 git_repo_path, 1887 git_repo_path,
1877 vec![ 1888 vec![
1878 nostr::Filter::default() 1889 nostr::Filter::default()
1879 .kind(nostr::Kind::GitPatch) 1890 .kinds([
1880 .events(revision_roots) 1891 nostr::Kind::GitPatch,
1892 KIND_PULL_REQUEST,
1893 KIND_PULL_REQUEST_UPDATE,
1894 ])
1895 .events(revision_roots.clone())
1896 .authors(permissioned_users.clone()),
1897 nostr::Filter::default()
1898 .kinds([
1899 nostr::Kind::GitPatch,
1900 KIND_PULL_REQUEST,
1901 KIND_PULL_REQUEST_UPDATE,
1902 ])
1903 .custom_tags(SingleLetterTag::uppercase(Alphabet::E), revision_roots)
1881 .authors(permissioned_users.clone()), 1904 .authors(permissioned_users.clone()),
1882 ], 1905 ],
1883 ) 1906 )