chore: update nostr sdk

This commit is contained in:
2026-03-25 13:52:21 +07:00
parent 99363475e0
commit d36364d60d
7 changed files with 282 additions and 181 deletions

393
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -163,7 +163,7 @@ impl ChatRegistry {
continue; continue;
}; };
match message { match *message {
RelayMessage::Event { event, .. } => { RelayMessage::Event { event, .. } => {
// Keep track of which relays have seen this event // Keep track of which relays have seen this event
{ {

View File

@@ -201,15 +201,12 @@ impl ChatPanel {
let mut notifications = client.notifications(); let mut notifications = client.notifications();
while let Some(notification) = notifications.next().await { while let Some(notification) = notifications.next().await {
if let ClientNotification::Message { if let ClientNotification::Message { message, relay_url } = notification
message: && let RelayMessage::Ok {
RelayMessage::Ok {
event_id, event_id,
status, status,
message, message,
}, } = *message
relay_url,
} = notification
{ {
let sent_ids = sent_ids.read().await; let sent_ids = sent_ids.read().await;

View File

@@ -44,6 +44,7 @@ fn main() {
cx.set_menus(vec![Menu { cx.set_menus(vec![Menu {
name: "Coop".into(), name: "Coop".into(),
items: vec![MenuItem::action("Quit", Quit)], items: vec![MenuItem::action("Quit", Quit)],
disabled: false,
}]); }]);
// Set up the window bounds // Set up the window bounds

View File

@@ -149,10 +149,8 @@ impl DeviceRegistry {
let mut processed_events = HashSet::new(); let mut processed_events = HashSet::new();
while let Some(notification) = notifications.next().await { while let Some(notification) = notifications.next().await {
if let ClientNotification::Message { if let ClientNotification::Message { message, .. } = notification
message: RelayMessage::Event { event, .. }, && let RelayMessage::Event { event, .. } = *message
..
} = notification
{ {
if !processed_events.insert(event.id) { if !processed_events.insert(event.id) {
// Skip if the event has already been processed // Skip if the event has already been processed

View File

@@ -135,7 +135,7 @@ impl PersonRegistry {
continue; continue;
}; };
if let RelayMessage::Event { event, .. } = message { if let RelayMessage::Event { event, .. } = *message {
// Skip if the event has already been processed // Skip if the event has already been processed
if !processed.insert(event.id) { if !processed.insert(event.id) {
continue; continue;

View File

@@ -100,7 +100,7 @@ impl RelayAuth {
while let Some(notification) = notifications.next().await { while let Some(notification) = notifications.next().await {
if let ClientNotification::Message { relay_url, message } = notification { if let ClientNotification::Message { relay_url, message } = notification {
match message { match *message {
RelayMessage::Auth { challenge } => { RelayMessage::Auth { challenge } => {
if challenges.insert(challenge.clone()) { if challenges.insert(challenge.clone()) {
let request = Arc::new(AuthRequest::new(challenge, relay_url)); let request = Arc::new(AuthRequest::new(challenge, relay_url));
@@ -221,9 +221,8 @@ impl RelayAuth {
while let Some(notification) = notifications.next().await { while let Some(notification) = notifications.next().await {
match notification { match notification {
RelayNotification::Message { RelayNotification::Message { message } => {
message: RelayMessage::Ok { event_id, .. }, if let RelayMessage::Ok { event_id, .. } = *message {
} => {
if id != event_id { if id != event_id {
continue; continue;
} }
@@ -247,6 +246,7 @@ impl RelayAuth {
return Ok(()); return Ok(());
} }
}
RelayNotification::AuthenticationFailed => break, RelayNotification::AuthenticationFailed => break,
_ => {} _ => {}
} }