Class MessageInfo

Class Documentation

class MessageInfo

Message info container.

Contains metadata about a received message.

Public Functions

MessageInfo(const Timestamp &source_timestamp, const Timestamp &received_timestamp, const Gid &publisher_gid)

Constructor.

MessageInfo(const MessageInfo&) = default
~MessageInfo()
const Timestamp &source_timestamp() const

Get the message source timestamp.

const Timestamp &received_timestamp() const

Get the message reception timestamp.

const Gid &publisher_gid() const

Get the publisher GID.

Public Static Functions

static std::optional<MessageInfo> from_headers(const EmailHeaders &headers)

Get a MessageInfo object from email headers.

The received timestamp will be created using Timestamp::now().

Parameters:

headers – the email headers

Returns:

the message info object, or std::nullopt if the email headers don’t contain the expected info

Public Static Attributes

static constexpr auto HEADER_PUBLISHER_GID = "Publisher-GID"

Custom header name for publisher GID.