Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-10-25 20:32:00 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2022-11-08 16:57:01 +0300
commit51760fb47e14d54e4fc265ed85616ae0863318d1 (patch)
tree8e990f6bf188f4436f687b4dbd3420bcb717aaca
parent6f0af9cd03e2e52385f03fc909b84f367b3d77ff (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.php12
-rw-r--r--lib/IMAP/Threading/DatabaseMessage.php1
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(),
]
);
}