mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 00:11:01 +00:00
Update person_relay.last_fetched for all relay-sourced events, even when we already have the event
This commit is contained in:
parent
f9880111d1
commit
1c8bfdd2d0
@ -95,6 +95,16 @@ pub async fn process_new_event(
|
||||
e
|
||||
);
|
||||
}
|
||||
|
||||
// Create the person if missing in the database
|
||||
GLOBALS
|
||||
.people
|
||||
.create_all_if_missing(&[event.pubkey.into()])
|
||||
.await?;
|
||||
|
||||
// Update person_relay.last_fetched
|
||||
DbPersonRelay::upsert_last_fetched(event.pubkey.as_hex_string(), url.to_owned(), now)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,18 +129,6 @@ pub async fn process_new_event(
|
||||
}
|
||||
|
||||
if from_relay {
|
||||
if let Some(ref url) = seen_on {
|
||||
// Create the person if missing in the database
|
||||
GLOBALS
|
||||
.people
|
||||
.create_all_if_missing(&[event.pubkey.into()])
|
||||
.await?;
|
||||
|
||||
// Update person_relay.last_fetched
|
||||
DbPersonRelay::upsert_last_fetched(event.pubkey.as_hex_string(), url.to_owned(), now)
|
||||
.await?;
|
||||
}
|
||||
|
||||
// Save the tags into event_tag table
|
||||
for (seq, tag) in event.tags.iter().enumerate() {
|
||||
// Save into database
|
||||
|
Loading…
Reference in New Issue
Block a user