From 63d1b3d8abea31fbfd990e8d44283defd3552561 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Fri, 30 Dec 2022 22:22:19 +1300 Subject: [PATCH] bugfix --- src/process.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/process.rs b/src/process.rs index d46c4fa6..3e98a3ff 100644 --- a/src/process.rs +++ b/src/process.rs @@ -43,6 +43,30 @@ pub async fn process_new_event( }; DbEventSeen::replace(db_event_seen).await?; + // Create the person if missing in the database + DbPerson::populate_new_people().await?; + + // Create the person if missing in GLOBALS.people + // FIXME - if the database has better data we should get it. + // we should fix that by making GLOBALS.people an + // object that persists on it's backend. + let _ = GLOBALS + .people + .write() + .await + .entry(event.pubkey) + .or_insert_with(|| DbPerson { + pubkey: event.pubkey.into(), + name: None, + about: None, + picture: None, + dns_id: None, + dns_id_valid: 0, + dns_id_last_checked: None, + metadata_at: None, + followed: 0, + }); + // Update person_relay.last_fetched DbPersonRelay::upsert_last_fetched( event.pubkey.as_hex_string(),