Treat the rumor as having the giftwrap id so relationships/viewed/etc still work

This commit is contained in:
Mike Dilger 2023-08-24 13:11:40 +12:00
parent 5ddaa830ce
commit 2fe25503ff
2 changed files with 4 additions and 1 deletions

View File

@ -120,10 +120,11 @@ pub async fn process_new_event(
// If it is a GiftWrap, from here on out operate on the Rumor
let mut event: &Event = event; // take ownership of this reference
let rumor_event: Event;
let mut rumor_event: Event;
if event.kind == EventKind::GiftWrap {
let rumor = GLOBALS.signer.unwrap_giftwrap(event)?;
rumor_event = rumor.into_event_with_bad_signature();
rumor_event.id = event.id; // Lie so it's handled with the giftwrap's id
event = &rumor_event;
}

View File

@ -54,7 +54,9 @@ impl NoteData {
secure = true;
if let Ok(rumor) = GLOBALS.signer.unwrap_giftwrap(&event) {
// Use the rumor for subsequent processing
let id = event.id;
event = rumor.into_event_with_bad_signature();
event.id = id; // lie, keep the giftwrap id
}
}