Public media helpers shared by send and receive flows.
The media domain is split into smaller files under lib/ex_wapp/domains/media/
so the public API stays easy to find while crypto, HTTP, and source-handling
details live in focused modules.
Summary
Types
Media kinds currently supported by the high-level API.
Accepted media input values when sending a message.
Functions
Builds the authenticated server-error receipt used to re-request expired media.
Decrypts a mediaretry notification with the original message media key.
Normalizes a send source into plaintext bytes.
Converts upload metadata into a reusable download reference.
Derives the media-retry wrapping key from a media key.
Types
@type media_type() :: :image | :audio | :document
Media kinds currently supported by the high-level API.
@type source() :: {:bytes, binary()} | {:path, Path.t()} | ExWapp.Media.Upload.t()
Accepted media input values when sending a message.
{:bytes, binary} keeps everything in memory, {:path, path} reads from
disk, and %ExWapp.Media.Upload{} skips the upload step when the caller
already has WhatsApp upload metadata.
Functions
Builds the authenticated server-error receipt used to re-request expired media.
Decrypts a mediaretry notification with the original message media key.
Normalizes a send source into plaintext bytes.
This is the boundary between the user-facing send API and the upload
pipeline. Existing %Upload{} values are rejected because they already
represent uploaded server-side media rather than local plaintext bytes.
@spec ref_from_upload( ExWapp.Media.Upload.t(), keyword() ) :: ExWapp.Media.Ref.t()
Converts upload metadata into a reusable download reference.
The resulting %ExWapp.Media.Ref{} can be attached to an event payload or
passed back into ExWapp.download_media/3.
Derives the media-retry wrapping key from a media key.