diff --git a/src/profiles.rs b/src/profiles.rs index 9e03a98..602d6bc 100644 --- a/src/profiles.rs +++ b/src/profiles.rs @@ -135,7 +135,7 @@ pub fn import_profile( None => secret_hex.to_string(), }; let created_at = unix_timestamp()?; - let metadata = fetch_profile_metadata(&public_key, &relays::enabled_urls(settings)); + let metadata = fetch_profile_metadata(&keys.public_key(), &relays::enabled_urls(settings)); let label = if label.trim().is_empty() { metadata .as_ref() @@ -496,12 +496,12 @@ fn publish_metadata_blocking( /// Best-effort lookup of the account's latest kind-0 metadata. Import must /// still succeed when relays are unavailable, so lookup failures are ignored. -fn fetch_profile_metadata(npub: &str, relay_urls: &[String]) -> Option { +fn fetch_profile_metadata(public_key: &PublicKey, relay_urls: &[String]) -> Option { if relay_urls.is_empty() { return None; } - let public_key = PublicKey::from_bech32(npub).ok()?; let relay_urls = relay_urls.to_vec(); + let public_key = *public_key; std::thread::spawn(move || { tokio::runtime::Runtime::new().ok()?.block_on(async move { let client =