diff options
Diffstat (limited to 'src/nostr/builder.rs')
| -rw-r--r-- | src/nostr/builder.rs | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs index ef1b700..34014db 100644 --- a/src/nostr/builder.rs +++ b/src/nostr/builder.rs | |||
| @@ -103,7 +103,7 @@ impl Nip34WritePolicy { | |||
| 103 | let event_id_str = event.id.to_bech32().unwrap_or_else(|_| event.id.to_hex()); | 103 | let event_id_str = event.id.to_bech32().unwrap_or_else(|_| event.id.to_hex()); |
| 104 | 104 | ||
| 105 | match self.announcement_policy.validate(event).await { | 105 | match self.announcement_policy.validate(event).await { |
| 106 | AnnouncementResult::Accept => { | 106 | AnnouncementResult::Accept | AnnouncementResult::AcceptArchive => { |
| 107 | // Parse announcement to get repository details | 107 | // Parse announcement to get repository details |
| 108 | match RepositoryAnnouncement::from_event(event.clone()) { | 108 | match RepositoryAnnouncement::from_event(event.clone()) { |
| 109 | Ok(announcement) => { | 109 | Ok(announcement) => { |
| @@ -166,34 +166,6 @@ impl Nip34WritePolicy { | |||
| 166 | } | 166 | } |
| 167 | } | 167 | } |
| 168 | } | 168 | } |
| 169 | AnnouncementResult::AcceptArchive => { | ||
| 170 | // GRASP-05: Archive mode - accept announcement but don't create bare repository | ||
| 171 | match RepositoryAnnouncement::from_event(event.clone()) { | ||
| 172 | Ok(announcement) => { | ||
| 173 | tracing::info!( | ||
| 174 | "Accepted archive announcement {} for {}/{} (GRASP-05 read-only mirror)", | ||
| 175 | event_id_str, | ||
| 176 | announcement.owner_npub(), | ||
| 177 | announcement.identifier | ||
| 178 | ); | ||
| 179 | // Don't create bare repository for archived announcements | ||
| 180 | |||
| 181 | // Check purgatory for state events that might now be authorized | ||
| 182 | self.check_purgatory_state_events_for_identifier(&announcement.identifier) | ||
| 183 | .await; | ||
| 184 | |||
| 185 | WritePolicyResult::Accept | ||
| 186 | } | ||
| 187 | Err(e) => { | ||
| 188 | tracing::warn!( | ||
| 189 | "Failed to parse archive announcement {}: {}", | ||
| 190 | event_id_str, | ||
| 191 | e | ||
| 192 | ); | ||
| 193 | WritePolicyResult::reject(format!("Failed to parse announcement: {}", e)) | ||
| 194 | } | ||
| 195 | } | ||
| 196 | } | ||
| 197 | AnnouncementResult::Reject(reason) => { | 169 | AnnouncementResult::Reject(reason) => { |
| 198 | tracing::warn!( | 170 | tracing::warn!( |
| 199 | "Rejected repository announcement {}: {}", | 171 | "Rejected repository announcement {}: {}", |