upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/git/authorization.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-24 11:36:39 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-24 11:36:39 +0000
commitc31a313ccf781e54fa15942bc882c1b113d3f590 (patch)
tree0dec673c40a7cff42651c290b8ded5f6d063a8ae /src/git/authorization.rs
parent5efdf431a1481f6fb7a17190b62588b81c5b1e65 (diff)
rename: fetch_repository_data -> fetch_repository_data_{excluding,with}_purgatory
The old name was ambiguous - it wasn't clear whether purgatory was included or not. The two variants are now explicitly named: - fetch_repository_data_excluding_purgatory: DB only - fetch_repository_data_with_purgatory: DB + purgatory overlay SyncContext trait method also renamed to fetch_repository_data_with_purgatory to match the free function it delegates to.
Diffstat (limited to 'src/git/authorization.rs')
-rw-r--r--src/git/authorization.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/git/authorization.rs b/src/git/authorization.rs
index 0e9a8ba..bf49800 100644
--- a/src/git/authorization.rs
+++ b/src/git/authorization.rs
@@ -234,7 +234,7 @@ pub struct RepositoryData {
234/// 234///
235/// This performs a single database query to fetch both announcement and state events, 235/// This performs a single database query to fetch both announcement and state events,
236/// which is more efficient than separate queries. 236/// which is more efficient than separate queries.
237pub async fn fetch_repository_data( 237pub async fn fetch_repository_data_excluding_purgatory(
238 database: &SharedDatabase, 238 database: &SharedDatabase,
239 identifier: &str, 239 identifier: &str,
240) -> Result<RepositoryData> { 240) -> Result<RepositoryData> {
@@ -298,7 +298,7 @@ pub async fn fetch_repository_data_with_purgatory(
298 identifier: &str, 298 identifier: &str,
299) -> Result<RepositoryData> { 299) -> Result<RepositoryData> {
300 // First, fetch from database 300 // First, fetch from database
301 let mut repo_data = fetch_repository_data(database, identifier).await?; 301 let mut repo_data = fetch_repository_data_excluding_purgatory(database, identifier).await?;
302 302
303 // Then, add announcements from purgatory 303 // Then, add announcements from purgatory
304 let purgatory_announcements = purgatory.get_announcements_by_identifier(identifier); 304 let purgatory_announcements = purgatory.get_announcements_by_identifier(identifier);
@@ -511,7 +511,7 @@ pub async fn get_authorization_from_db(
511 identifier: &str, 511 identifier: &str,
512) -> Result<AuthorizationResult> { 512) -> Result<AuthorizationResult> {
513 // Fetch all repository data with a single query 513 // Fetch all repository data with a single query
514 let repo_data = fetch_repository_data(database, identifier).await?; 514 let repo_data = fetch_repository_data_excluding_purgatory(database, identifier).await?;
515 515
516 if repo_data.announcements.is_empty() { 516 if repo_data.announcements.is_empty() {
517 return Ok(AuthorizationResult::denied( 517 return Ok(AuthorizationResult::denied(