feat: respect the relay hint

This commit is contained in:
reya
2024-06-07 09:07:33 +07:00
parent 799835a629
commit 04fe0fcec8
4 changed files with 423 additions and 579 deletions

View File

@@ -13,9 +13,8 @@ pub async fn get_event(id: &str, state: State<'_, Nostr>) -> Result<String, Stri
Nip19::Event(event) => {
let relays = event.relays;
for relay in relays.into_iter() {
let url = Url::from_str(&relay).unwrap();
let _ = client.add_relay(&url).await.unwrap_or_default();
client.connect_relay(&url).await.unwrap_or_default();
let _ = client.add_relay(&relay).await.unwrap_or_default();
client.connect_relay(&relay).await.unwrap_or_default();
}
Some(event.event_id)
}