generated from Nodarx/template
feat: implement content cache
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -20,12 +20,20 @@ use KTXF\Mail\Object\MessagePropertiesMutableAbstract;
|
||||
*/
|
||||
class MessageProperties extends MessagePropertiesMutableAbstract {
|
||||
|
||||
/**
|
||||
* Part ids of text sections that were cut off when fetched (cache only, not part of the API shape)
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
private array $incompleteSections = [];
|
||||
|
||||
/**
|
||||
* Convert IMAP data to mail message properties object.
|
||||
*/
|
||||
public function fromImap(Message $message): static
|
||||
{
|
||||
$this->data[static::PROPERTY_SIZE] = $message->size();
|
||||
$this->incompleteSections = $message->truncatedSections();
|
||||
|
||||
if ($message->messageId() !== null) {
|
||||
$this->data[static::PROPERTY_URID] = $message->messageId();
|
||||
@@ -111,6 +119,22 @@ class MessageProperties extends MessagePropertiesMutableAbstract {
|
||||
|
||||
// ── Cache (meta store / content store) ───────────────────────────────────
|
||||
|
||||
/**
|
||||
* Part ids of text sections that were cut off when fetched and must be completed on open.
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getIncompleteSections(): array
|
||||
{
|
||||
return $this->incompleteSections;
|
||||
}
|
||||
|
||||
public function setIncompleteSections(string ...$partIds): static
|
||||
{
|
||||
$this->incompleteSections = array_values(array_unique($partIds));
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialise the fields the meta store needs for list, filter and sort.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user