upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/nostr/builder.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-22 17:22:25 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-22 20:21:26 +0000
commit5d3d96c7f0397a079384b7291ff21df76029b126 (patch)
tree9bb558649611409b8612899776a865dd8232f783 /src/nostr/builder.rs
parent777509bb03f5233b3ef470329d23cec371baf53c (diff)
accept all UserGraspList for better discovery
Diffstat (limited to 'src/nostr/builder.rs')
-rw-r--r--src/nostr/builder.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs
index c9bd1e1..84d8ab4 100644
--- a/src/nostr/builder.rs
+++ b/src/nostr/builder.rs
@@ -13,7 +13,7 @@ use nostr_relay_builder::prelude::*;
13use crate::config::{Config, DatabaseBackend}; 13use crate::config::{Config, DatabaseBackend};
14use crate::nostr::events::{ 14use crate::nostr::events::{
15 RepositoryAnnouncement, RepositoryState, KIND_PR, KIND_PR_UPDATE, KIND_REPOSITORY_ANNOUNCEMENT, 15 RepositoryAnnouncement, RepositoryState, KIND_PR, KIND_PR_UPDATE, KIND_REPOSITORY_ANNOUNCEMENT,
16 KIND_REPOSITORY_STATE, 16 KIND_REPOSITORY_STATE, KIND_USER_GRASP_LIST,
17}; 17};
18use crate::nostr::policy::{ 18use crate::nostr::policy::{
19 AnnouncementPolicy, AnnouncementResult, PolicyContext, PrEventPolicy, ReferenceResult, 19 AnnouncementPolicy, AnnouncementResult, PolicyContext, PrEventPolicy, ReferenceResult,
@@ -257,6 +257,16 @@ impl WritePolicy for Nip34WritePolicy {
257 KIND_REPOSITORY_ANNOUNCEMENT => self.handle_announcement(event).await, 257 KIND_REPOSITORY_ANNOUNCEMENT => self.handle_announcement(event).await,
258 KIND_REPOSITORY_STATE => self.handle_state(event).await, 258 KIND_REPOSITORY_STATE => self.handle_state(event).await,
259 KIND_PR | KIND_PR_UPDATE => self.handle_pr_event(event).await, 259 KIND_PR | KIND_PR_UPDATE => self.handle_pr_event(event).await,
260 KIND_USER_GRASP_LIST => {
261 // Accept all kind 10317 (User Grasp List) events
262 // for better GRASP repository discovery
263 tracing::debug!(
264 event_id = %event.id.to_bech32().unwrap_or_else(|_| event.id.to_hex()),
265 author = %event.pubkey.to_hex(),
266 "Accepted kind 10317 user grasp list"
267 );
268 PolicyResult::Accept
269 }
260 _ => self.handle_related_event(event, "Event").await, 270 _ => self.handle_related_event(event, "Event").await,
261 } 271 }
262 }) 272 })