chore: update deps

This commit is contained in:
2025-07-16 15:18:18 +07:00
parent c7ab75d310
commit 73a2678278
3 changed files with 364 additions and 86 deletions

View File

@@ -21,7 +21,6 @@ use gpui::{point, SharedString, TitlebarOptions};
#[cfg(target_os = "linux")]
use gpui::{WindowBackgroundAppearance, WindowDecorations};
use identity::Identity;
use itertools::Itertools;
use nostr_sdk::prelude::*;
use registry::Registry;
use smol::channel::{self, Sender};
@@ -406,17 +405,11 @@ async fn handle_nostr_notifications(
.kind(Kind::InboxRelays)
.limit(1);
let relay_urls = nip65::extract_owned_relay_list(event.into_owned())
.map(|(url, _)| url)
.collect_vec();
if !relay_urls.is_empty() {
client
.subscribe_to(relay_urls, filter, Some(opts))
.await
.ok();
log::info!("Subscribe for messaging relays")
if client.subscribe(filter, Some(opts)).await.is_ok() {
log::info!(
"Subscribed to get DM relays: {}",
event.pubkey.to_bech32().unwrap()
)
}
}
Kind::ReleaseArtifactSet => {

View File

@@ -1,5 +1,6 @@
use std::fs;
use std::sync::OnceLock;
use std::time::Duration;
use nostr_connect::prelude::*;
use nostr_sdk::prelude::*;
@@ -47,9 +48,19 @@ pub fn nostr_client() -> &'static Client {
.install_default()
.ok();
let opts = ClientOptions::new().gossip(true);
let lmdb = NostrLMDB::open(nostr_file()).expect("Database is NOT initialized");
let opts = ClientOptions::new()
// Coop isn't social client,
// but it needs this option because it needs user's NIP65 Relays to fetch NIP17 Relays.
.gossip(true)
// TODO: Coop should handle authentication by itself
.automatic_authentication(true)
// Sleep after idle for 5 seconds
.sleep_when_idle(SleepWhenIdle::Enabled {
timeout: Duration::from_secs(5),
});
ClientBuilder::default().database(lmdb).opts(opts).build()
})
}