feat: implement content cache

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-29 19:56:30 -04:00
parent d28800a04e
commit 0250b5a847
10 changed files with 511 additions and 8 deletions
+13
View File
@@ -16,6 +16,7 @@ final class Message
* @param list<MessageAddress> $bcc
* @param array<string, string> $bodySections
* @param list<string> $references message ids from the References header, without angle brackets
* @param list<string> $truncatedSections part ids of text sections cut off by a partial fetch
*/
public function __construct(
private readonly int $sequence,
@@ -37,6 +38,7 @@ final class Message
private readonly ?MessagePart $bodyStructure,
private readonly array $bodySections,
private readonly array $references = [],
private readonly array $truncatedSections = [],
) {}
public function sequence(): int
@@ -166,6 +168,16 @@ final class Message
return $this->bodySections;
}
/**
* Part ids of text sections that were cut off by a partial fetch.
*
* @return list<string>
*/
public function truncatedSections(): array
{
return $this->truncatedSections;
}
public function bodyRaw(): ?string
{
return $this->bodySections[''] ?? null;
@@ -196,6 +208,7 @@ final class Message
$bodyStructure,
$bodySections,
$this->references,
$this->truncatedSections,
);
}
}