mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 03:33:53 +00:00
Tweak NIP-35 follow support to work even if relays missing
This commit is contained in:
parent
5653bb781a
commit
03611e7323
@ -438,15 +438,21 @@ impl Overlord {
|
||||
None => return Err(Error::Nip05NotFound),
|
||||
};
|
||||
|
||||
// Save person
|
||||
DbPerson::upsert_valid_nip05(
|
||||
(*pubkey).into(),
|
||||
dns_id.clone(),
|
||||
Unixtime::now().unwrap().0 as u64,
|
||||
)
|
||||
.await?;
|
||||
|
||||
info!("Followed {}", &dns_id);
|
||||
|
||||
let relays = match nip05.relays.get(pubkey) {
|
||||
Some(relays) => relays,
|
||||
None => return Err(Error::Nip35NotFound),
|
||||
};
|
||||
|
||||
// Save person
|
||||
DbPerson::upsert_valid_nip05((*pubkey).into(), dns_id, Unixtime::now().unwrap().0 as u64)
|
||||
.await?;
|
||||
|
||||
for relay in relays.iter() {
|
||||
// Save relay
|
||||
let db_relay = DbRelay::new(relay.to_string())?;
|
||||
@ -460,7 +466,7 @@ impl Overlord {
|
||||
.await?;
|
||||
}
|
||||
|
||||
info!("Followed {}@{} at {} relays", user, domain, relays.len());
|
||||
info!("Setup {} relays for {}", relays.len(), &dns_id);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user