Implements WhatsApp's media re-upload protocol.
When a CDN object is no longer available, a companion sends a
<receipt type="server-error"> containing an authenticated
ServerErrorReceipt. The phone answers with a mediaretry notification
carrying a fresh direct path encrypted with the same key.
Summary
Functions
Builds a media re-upload request addressed to the local primary identity.
Decrypts a mediaretry notification.
Derives the AES-256-GCM key used by media-retry payloads.
Types
@type result() :: :general_error | :success | :not_found | :decryption_error | non_neg_integer()
Functions
@spec build_receipt( String.t(), String.t(), String.t(), boolean(), String.t() | nil, binary() ) :: ExWapp.Binary.Node.t()
Builds a media re-upload request addressed to the local primary identity.
participant_jid is required only when the original message belongs to a
group. The encrypted protobuf is authenticated with the message ID as AAD.
Decrypts a mediaretry notification.
A successful result returns the refreshed direct path. Error code 2 is the
wire-level indication that the phone no longer has the media.
Derives the AES-256-GCM key used by media-retry payloads.