ids: find more unknown ids from inline notes

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2024-04-14 16:30:12 -07:00
parent 402a1337f2
commit 6f2aa56b9e

View File

@ -233,16 +233,31 @@ fn get_unknown_note_ids<'a>(
ids.insert(UnknownId::Pubkey(nprofile.pubkey()));
}
}
Mention::Event(ev) => {
if ndb.get_note_by_id(txn, ev.id()).is_err() {
Mention::Event(ev) => match ndb.get_note_by_id(txn, ev.id()) {
Err(_) => {
ids.insert(UnknownId::Id(ev.id()));
if let Some(pk) = ev.pubkey() {
if ndb.get_profile_by_pubkey(txn, pk).is_err() {
ids.insert(UnknownId::Pubkey(pk));
}
}
}
}
Mention::Note(note) => {
if ndb.get_note_by_id(txn, note.id()).is_err() {
Ok(note) => {
if ndb.get_profile_by_pubkey(txn, note.pubkey()).is_err() {
ids.insert(UnknownId::Pubkey(note.pubkey()));
}
}
},
Mention::Note(note) => match ndb.get_note_by_id(txn, note.id()) {
Err(_) => {
ids.insert(UnknownId::Id(note.id()));
}
}
Ok(note) => {
if ndb.get_profile_by_pubkey(txn, note.pubkey()).is_err() {
ids.insert(UnknownId::Pubkey(note.pubkey()));
}
}
},
_ => {}
},