diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-05 14:31:47 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-05 14:31:47 +0000 |
| commit | f8235b7977c673524c12a229eddb7ace6b0c2c0d (patch) | |
| tree | 1725861f36085adc7b7c3f033e67cde910fe4c75 /src/nostr/builder.rs | |
| parent | 8cb45487d7125a14d15c15dfc14b0804eb22ffd6 (diff) | |
purgatory: git data sync applies state and saves event
Diffstat (limited to 'src/nostr/builder.rs')
| -rw-r--r-- | src/nostr/builder.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs index da81e64..db2f59b 100644 --- a/src/nostr/builder.rs +++ b/src/nostr/builder.rs | |||
| @@ -74,6 +74,14 @@ impl Nip34WritePolicy { | |||
| 74 | &self.ctx.purgatory | 74 | &self.ctx.purgatory |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | /// Set the local relay for purgatory notifications. | ||
| 78 | /// | ||
| 79 | /// This must be called after the relay is created since the relay depends | ||
| 80 | /// on this policy, but purgatory sync needs the relay to notify subscribers. | ||
| 81 | pub fn set_local_relay(&self, relay: nostr_relay_builder::LocalRelay) { | ||
| 82 | self.ctx.set_local_relay(relay); | ||
| 83 | } | ||
| 84 | |||
| 77 | /// Handle repository announcement event | 85 | /// Handle repository announcement event |
| 78 | async fn handle_announcement(&self, event: &Event) -> WritePolicyResult { | 86 | async fn handle_announcement(&self, event: &Event) -> WritePolicyResult { |
| 79 | let event_id_str = event.id.to_bech32().unwrap_or_else(|_| event.id.to_hex()); | 87 | let event_id_str = event.id.to_bech32().unwrap_or_else(|_| event.id.to_hex()); |