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;
};
match message {
match *message {
RelayMessage::Event { event, .. } => {
// Keep track of which relays have seen this event
{

View File

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

View File

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

View File

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

View File

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

View File

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