diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-22 17:22:25 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-22 20:21:26 +0000 |
| commit | 5d3d96c7f0397a079384b7291ff21df76029b126 (patch) | |
| tree | 9bb558649611409b8612899776a865dd8232f783 /src/sync | |
| parent | 777509bb03f5233b3ef470329d23cec371baf53c (diff) | |
accept all UserGraspList for better discovery
Diffstat (limited to 'src/sync')
| -rw-r--r-- | src/sync/filters.rs | 4 | ||||
| -rw-r--r-- | src/sync/self_subscriber.rs | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/sync/filters.rs b/src/sync/filters.rs index 963fa02..dddc49c 100644 --- a/src/sync/filters.rs +++ b/src/sync/filters.rs | |||
| @@ -13,14 +13,16 @@ use std::collections::HashSet; | |||
| 13 | 13 | ||
| 14 | use nostr_sdk::prelude::*; | 14 | use nostr_sdk::prelude::*; |
| 15 | 15 | ||
| 16 | /// Layer 1: Announcements filter (kinds 30617 + 30618) | 16 | /// Layer 1: Announcements filter (kinds 30617 + 30618 + 10317) |
| 17 | /// | 17 | /// |
| 18 | /// Subscribed ONCE on connect - NOT included in consolidation rebuilds. | 18 | /// Subscribed ONCE on connect - NOT included in consolidation rebuilds. |
| 19 | /// Note: 30618 is ONLY synced from remote relays, not self-subscribed. | 19 | /// Note: 30618 is ONLY synced from remote relays, not self-subscribed. |
| 20 | /// Note: 10317 (User Grasp List) is synced for better GRASP discovery. | ||
| 20 | pub fn build_announcement_filter(since: Option<Timestamp>) -> Filter { | 21 | pub fn build_announcement_filter(since: Option<Timestamp>) -> Filter { |
| 21 | let filter = Filter::new().kinds([ | 22 | let filter = Filter::new().kinds([ |
| 22 | Kind::Custom(30617), // Repository announcements | 23 | Kind::Custom(30617), // Repository announcements |
| 23 | Kind::Custom(30618), // Maintainer lists | 24 | Kind::Custom(30618), // Maintainer lists |
| 25 | Kind::Custom(10317), // User Grasp List | ||
| 24 | ]); | 26 | ]); |
| 25 | 27 | ||
| 26 | match since { | 28 | match since { |
diff --git a/src/sync/self_subscriber.rs b/src/sync/self_subscriber.rs index 9643fc0..09e3b56 100644 --- a/src/sync/self_subscriber.rs +++ b/src/sync/self_subscriber.rs | |||
| @@ -285,6 +285,7 @@ impl SelfSubscriber { | |||
| 285 | 285 | ||
| 286 | // Subscribe to announcement and root event kinds | 286 | // Subscribe to announcement and root event kinds |
| 287 | // Per v4 spec: 30617, 1617, 1618, 1621 (NOT 30618) | 287 | // Per v4 spec: 30617, 1617, 1618, 1621 (NOT 30618) |
| 288 | // Plus kind 10317 (User Grasp List) for GRASP discovery | ||
| 288 | // Check if we have a last_connected time for reconnect filtering | 289 | // Check if we have a last_connected time for reconnect filtering |
| 289 | let filter = if let Some(last) = self.last_connected { | 290 | let filter = if let Some(last) = self.last_connected { |
| 290 | // Quick reconnect - use since filter (15 min buffer) | 291 | // Quick reconnect - use since filter (15 min buffer) |
| @@ -299,6 +300,7 @@ impl SelfSubscriber { | |||
| 299 | Kind::Custom(1617), // Patches | 300 | Kind::Custom(1617), // Patches |
| 300 | Kind::Custom(1621), // Issues | 301 | Kind::Custom(1621), // Issues |
| 301 | Kind::Custom(1618), // Pull Requests | 302 | Kind::Custom(1618), // Pull Requests |
| 303 | Kind::Custom(10317), // User Grasp List | ||
| 302 | ]) | 304 | ]) |
| 303 | .since(since) | 305 | .since(since) |
| 304 | } else { | 306 | } else { |
| @@ -308,6 +310,7 @@ impl SelfSubscriber { | |||
| 308 | Kind::Custom(1617), // Patches | 310 | Kind::Custom(1617), // Patches |
| 309 | Kind::Custom(1621), // Issues | 311 | Kind::Custom(1621), // Issues |
| 310 | Kind::Custom(1618), // Pull Requests | 312 | Kind::Custom(1618), // Pull Requests |
| 313 | Kind::Custom(10317), // User Grasp List | ||
| 311 | ]) | 314 | ]) |
| 312 | }; | 315 | }; |
| 313 | 316 | ||