diff --git a/Cargo.toml b/Cargo.toml index 5bc1354c..1e0ccc7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ chrono = "0.4.23" easy-hasher = "2.2.1" lightning-invoice = "0.22.0" log = "0.4.17" -nostr-sdk = "0.22" +nostr-sdk = "0.24.0" pretty_env_logger = "0.4.0" serde = { version = "1.0.149" } serde_json = "1.0.89" diff --git a/src/app/rate_user.rs b/src/app/rate_user.rs index 1a49ce8e..8aaacfa7 100644 --- a/src/app/rate_user.rs +++ b/src/app/rate_user.rs @@ -81,7 +81,10 @@ pub async fn get_nip_33_event( info!("Message sent : {:?}", msg); // Send msg to relay - relay.send_msg(msg.clone(), true).await.unwrap(); + relay + .send_msg(msg.clone(), Some(Duration::from_secs(30))) + .await + .unwrap(); // Wait notification from relays let mut notifications = client.notifications(); @@ -110,7 +113,10 @@ pub async fn get_nip_33_event( } // Unsubscribe - relay.send_msg(msg.clone(), true).await.unwrap(); + relay + .send_msg(msg.clone(), Some(Duration::from_secs(30))) + .await + .unwrap(); ev } diff --git a/src/util.rs b/src/util.rs index f68f6539..2f7bbe58 100644 --- a/src/util.rs +++ b/src/util.rs @@ -165,8 +165,9 @@ pub async fn send_dm( content: String, ) -> Result<()> { info!("DM content: {content:#?}"); - let event = EventBuilder::new_encrypted_direct_msg(sender_keys, *receiver_pubkey, content)? - .to_event(sender_keys)?; + let event = + EventBuilder::new_encrypted_direct_msg(sender_keys, *receiver_pubkey, content, None)? + .to_event(sender_keys)?; info!("Sending event: {event:#?}"); client.send_event(event).await?; @@ -263,10 +264,10 @@ pub async fn connect_nostr() -> Result { let nostr_settings = Settings::get_nostr(); // Create new client let client = Client::new(&my_keys); - let relays = &nostr_settings.relays; + let relays = nostr_settings.relays; // Add relays - for r in relays.iter() { + for r in relays.into_iter() { client.add_relay(r, None).await?; }