Skip to main content

resend_failed_dm

Function resend_failed_dm 

Source
pub async fn resend_failed_dm(
    receiver_npub: &str,
    failed_msg_id: &str,
    config: &SendConfig,
    callback: Arc<dyn SendCallback>,
) -> Result<bool, String>
Expand description

Manually retry a failed DM by republishing the EXACT retained recipient wrap. Same outer event id → relays no-op the duplicate, so a first send that silently landed can never double-post, regardless of the recipient’s client.

Ok(true) — a retained wrap was found and the resend went through the normal retry loop (message ends sent, or red again ready to retry). The caller must NOT fall back. Ok(false) — nothing retained (old/pruned message, or the first send failed before a wrap was ever built, e.g. an upload error). The caller falls back to a fresh send — safe, since no wrap reached a relay in that case.