diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2022-10-25 20:32:00 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2022-11-08 16:57:01 +0300 |
commit | 51760fb47e14d54e4fc265ed85616ae0863318d1 (patch) | |
tree | 8e990f6bf188f4436f687b4dbd3420bcb717aaca | |
parent | 6f0af9cd03e2e52385f03fc909b84f367b3d77ff (diff) |
Improve debuggability of thread datafix/threading-memory-footprint
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
-rw-r--r-- | lib/IMAP/Threading/Container.php | 12 | ||||
-rw-r--r-- | lib/IMAP/Threading/DatabaseMessage.php | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/IMAP/Threading/Container.php b/lib/IMAP/Threading/Container.php index e57e390ac..9a25ad5fe 100644 --- a/lib/IMAP/Threading/Container.php +++ b/lib/IMAP/Threading/Container.php @@ -25,11 +25,12 @@ declare(strict_types=1); namespace OCA\Mail\IMAP\Threading; +use JsonSerializable; use RuntimeException; use function array_key_exists; use function spl_object_id; -class Container { +class Container implements JsonSerializable { /** @var Message|null */ private $message; @@ -147,4 +148,13 @@ class Container { public function getChildren(): array { return $this->children; } + + public function jsonSerialize() { + return [ + 'message' => $this->message, + 'id' => $this->id, + 'root' => $this->root, + 'children' => $this->children, + ]; + } } diff --git a/lib/IMAP/Threading/DatabaseMessage.php b/lib/IMAP/Threading/DatabaseMessage.php index a05dc8a47..eac8a44ff 100644 --- a/lib/IMAP/Threading/DatabaseMessage.php +++ b/lib/IMAP/Threading/DatabaseMessage.php @@ -110,6 +110,7 @@ class DatabaseMessage extends Message implements JsonSerializable { parent::jsonSerialize(), [ 'databaseId' => $this->databaseId, + 'threadRootId' => $this->getThreadRootId(), ] ); } |