.
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m48s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m37s
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m48s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m37s
This commit is contained in:
@@ -488,6 +488,18 @@ impl NostrRegistry {
|
||||
match res {
|
||||
Ok(event) => {
|
||||
log::info!("Received relay list event: {event:?}");
|
||||
|
||||
// Construct a filter to continuously receive relay list events
|
||||
let filter = Filter::new()
|
||||
.kind(Kind::RelayList)
|
||||
.author(public_key)
|
||||
.since(Timestamp::now());
|
||||
|
||||
// Subscribe to the relay list events
|
||||
client
|
||||
.subscribe_to(BOOTSTRAP_RELAYS, vec![filter], None)
|
||||
.await?;
|
||||
|
||||
return Ok(RelayState::Set);
|
||||
}
|
||||
Err(e) => {
|
||||
@@ -578,13 +590,23 @@ impl NostrRegistry {
|
||||
|
||||
// Stream events from the write relays
|
||||
let mut stream = client
|
||||
.stream_events_from(urls, vec![filter], Duration::from_secs(TIMEOUT))
|
||||
.stream_events_from(&urls, vec![filter], Duration::from_secs(TIMEOUT))
|
||||
.await?;
|
||||
|
||||
while let Some((_url, res)) = stream.next().await {
|
||||
match res {
|
||||
Ok(event) => {
|
||||
log::info!("Received messaging relays event: {event:?}");
|
||||
|
||||
// Construct a filter to continuously receive relay list events
|
||||
let filter = Filter::new()
|
||||
.kind(Kind::InboxRelays)
|
||||
.author(public_key)
|
||||
.since(Timestamp::now());
|
||||
|
||||
// Subscribe to the relay list events
|
||||
client.subscribe_to(&urls, vec![filter], None).await?;
|
||||
|
||||
return Ok(RelayState::Set);
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user