Class CommunicationInfo

Class Documentation

class CommunicationInfo

Communication info container.

Contains metadata about a specific communication instance. This container is too abstract to be used by itself.

Public Functions

CommunicationInfo(const Timestamp &source_timestamp, const Timestamp &received_timestamp, const Gid &source_gid)

Constructor.

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

Get the source timestamp.

const Timestamp &received_timestamp() const

Get the reception timestamp.

const Gid &source_gid() const

Get the source GID.

Public Static Functions

static std::optional<CommunicationInfo> from_headers(const EmailHeaders &headers, const std::string &source_gid_header)

Get a CommunicationInfo object from email headers.

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

Parameters:
  • headers – the email headers

  • source_gid_header – the name of the header for the source GID

Returns:

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

Public Static Attributes

static constexpr auto HEADER_SOURCE_TIMESTAMP = "Source-Timestamp"

Custom header name for source timestamp.