Updates for upstream changes

This commit is contained in:
Mike Dilger 2023-01-11 20:42:48 +13:00
parent 9be60a5602
commit a90e0c0861

View File

@ -46,7 +46,7 @@ pub async fn validate_nip05(person: DbPerson) -> Result<(), Error> {
// Check if the response matches their public key // Check if the response matches their public key
match nip05.names.get(&user) { match nip05.names.get(&user) {
Some(pk) => { Some(pk) => {
if pk.as_hex_string() == person.pubkey.0 { if *pk == person.pubkey {
// Validated // Validated
GLOBALS GLOBALS
.people .people
@ -89,7 +89,7 @@ pub async fn get_and_follow_nip05(dns_id: String) -> Result<(), Error> {
.write() .write()
.await .await
.upsert_nip05_validity( .upsert_nip05_validity(
&(*pubkey).into(), pubkey,
Some(dns_id.clone()), Some(dns_id.clone()),
true, true,
Unixtime::now().unwrap().0 as u64, Unixtime::now().unwrap().0 as u64,
@ -101,7 +101,7 @@ pub async fn get_and_follow_nip05(dns_id: String) -> Result<(), Error> {
.people .people
.write() .write()
.await .await
.async_follow(&(*pubkey).into(), true) .async_follow(pubkey, true)
.await?; .await?;
tracing::info!("Followed {}", &dns_id); tracing::info!("Followed {}", &dns_id);
@ -120,7 +120,7 @@ pub async fn get_and_follow_nip05(dns_id: String) -> Result<(), Error> {
// Save person_relay // Save person_relay
DbPersonRelay::upsert_last_suggested_nip05( DbPersonRelay::upsert_last_suggested_nip05(
(*pubkey).into(), pubkey.clone(),
relay.inner().to_owned(), relay.inner().to_owned(),
Unixtime::now().unwrap().0 as u64, Unixtime::now().unwrap().0 as u64,
) )