mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
bugfix
This commit is contained in:
parent
47faa42c07
commit
63d1b3d8ab
@ -43,6 +43,30 @@ pub async fn process_new_event(
|
|||||||
};
|
};
|
||||||
DbEventSeen::replace(db_event_seen).await?;
|
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
|
// Update person_relay.last_fetched
|
||||||
DbPersonRelay::upsert_last_fetched(
|
DbPersonRelay::upsert_last_fetched(
|
||||||
event.pubkey.as_hex_string(),
|
event.pubkey.as_hex_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user