BUGFIX in update_metadata()

This commit is contained in:
Mike Dilger 2023-01-07 16:30:07 +13:00
parent 16b9027867
commit a8ad14ae27

View File

@ -86,8 +86,15 @@ impl People {
// Update the map // Update the map
let person = self.people.get_mut(pubkeyhex).unwrap(); let person = self.people.get_mut(pubkeyhex).unwrap();
// Determine whether to update it
let mut doit = person.metadata_at.is_none();
if let Some(metadata_at) = person.metadata_at { if let Some(metadata_at) = person.metadata_at {
if asof.0 > metadata_at { if asof.0 > metadata_at {
doit = true;
}
}
if doit {
// Process fresh metadata // Process fresh metadata
person.name = metadata.get("name"); person.name = metadata.get("name");
@ -122,7 +129,6 @@ impl People {
}) })
.await??; .await??;
} }
}
// Remove from failed avatars list so the UI will try to fetch the avatar again // Remove from failed avatars list so the UI will try to fetch the avatar again
GLOBALS.failed_avatars.write().await.remove(pubkeyhex); GLOBALS.failed_avatars.write().await.remove(pubkeyhex);