When sending DM17 giftwraps, don't error out because we can't unwrap the one for the counterparty

This commit is contained in:
Mike Dilger 2024-06-14 13:00:26 +12:00
parent 8f17ba076e
commit 04214b4803
2 changed files with 10 additions and 6 deletions

View File

@ -1798,8 +1798,8 @@ impl Overlord {
// Post them
for (event, relay_urls) in prepared_events.drain(..) {
// Process this event locally
crate::process::process_new_event(&event, None, None, false, false).await?;
// Process this event locally (ignore any error)
let _ = crate::process::process_new_event(&event, None, None, false, false).await;
// Engage minions to post
for url in relay_urls {

View File

@ -199,10 +199,14 @@ pub async fn process_new_event(
let mut event: &Event = event; // take ownership of this reference
let mut rumor_event: Event;
if event.kind == EventKind::GiftWrap {
let rumor = GLOBALS.identity.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;
if let Ok(rumor) = GLOBALS.identity.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;
} else {
// Not for us.
return Ok(());
}
}
if seen_on.is_some() {