upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/lib/client.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-10-20 14:34:52 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2025-10-20 14:50:07 +0100
commit165fb4e5ee16fe5444c0dd0264c4a327aef2148d (patch)
tree91d6c9596190a950707a75d6ec53f89f718bf6b0 /src/lib/client.rs
parent890cf4649fe9b66ecd457acfd1be61d4b8c8d3d0 (diff)
fix: reading NIP-22 style Status events during fetch
also fix the report so that we show nip10 style statuses too
Diffstat (limited to 'src/lib/client.rs')
-rw-r--r--src/lib/client.rs24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs
index 92bf266..c08cd04 100644
--- a/src/lib/client.rs
+++ b/src/lib/client.rs
@@ -31,7 +31,7 @@ use indicatif::{MultiProgress, ProgressBar, ProgressDrawTarget, ProgressState, P
31use mockall::*; 31use mockall::*;
32use nostr::{ 32use nostr::{
33 Event, 33 Event,
34 event::{TagKind, TagStandard, UnsignedEvent}, 34 event::UnsignedEvent,
35 filter::Alphabet, 35 filter::Alphabet,
36 nips::{ 36 nips::{
37 nip01::Coordinate, 37 nip01::Coordinate,
@@ -1575,19 +1575,15 @@ async fn process_fetched_events(
1575 } 1575 }
1576 for event in &events { 1576 for event in &events {
1577 if !request.existing_events.contains(&event.id) 1577 if !request.existing_events.contains(&event.id)
1578 && (!event 1578 && !event.tags.iter().any(|t| {
1579 .tags 1579 t.as_slice().len() > 1
1580 .event_ids() 1580 && (t.as_slice()[0].eq("E") || t.as_slice()[0].eq("e"))
1581 .any(|id| report.proposals.contains(id)) 1581 && if let Ok(id) = EventId::parse(&t.as_slice()[1]) {
1582 || event 1582 report.proposals.contains(&id)
1583 .tags 1583 } else {
1584 .filter_standardized(TagKind::Custom(std::borrow::Cow::Borrowed("E"))) 1584 false
1585 .filter_map(|t| match t { 1585 }
1586 TagStandard::Event { event_id, .. } => Some(event_id), 1586 })
1587 TagStandard::EventReport(event_id, ..) => Some(event_id),
1588 _ => None,
1589 })
1590 .any(|id| report.proposals.contains(id)))
1591 { 1587 {
1592 if (event.kind.eq(&Kind::GitPatch) && !event_is_patch_set_root(event)) 1588 if (event.kind.eq(&Kind::GitPatch) && !event_is_patch_set_root(event))
1593 || event.kind.eq(&KIND_PULL_REQUEST_UPDATE) 1589 || event.kind.eq(&KIND_PULL_REQUEST_UPDATE)