From 1b0185381cad17c1c132be57a365d2f0ad477397 Mon Sep 17 00:00:00 2001 From: tiacardoso <36483226+tiacardoso@users.noreply.github.com> Date: Wed, 14 Feb 2018 18:03:11 +0000 Subject: [PATCH] Update Message.php (#56) Enable support to get In-Reply-To property from Message header. --- src/IMAP/Message.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/IMAP/Message.php b/src/IMAP/Message.php index 97acb1e..af55293 100644 --- a/src/IMAP/Message.php +++ b/src/IMAP/Message.php @@ -69,6 +69,7 @@ class Message { * @var array $cc * @var array $bcc * @var array $reply_to + * @var string $in_reply_to * @var array $sender */ public $message_id = ''; @@ -80,6 +81,7 @@ class Message { public $cc = []; public $bcc = []; public $reply_to = []; + public $in_reply_to = ''; public $sender = []; /** @@ -284,6 +286,9 @@ private function parseHeader() { if (property_exists($header, 'reply_to')) { $this->reply_to = $this->parseAddresses($header->reply_to); } + if (property_exists($header, 'in_reply_to')) { + $this->in_reply_to = str_replace(['<', '>'], '', $header->in_reply_to); + } if (property_exists($header, 'sender')) { $this->sender = $this->parseAddresses($header->sender); } @@ -745,6 +750,13 @@ public function getBcc() { public function getReplyTo() { return $this->reply_to; } + + /** + * @return string + */ + public function getInReplyTo() { + return $this->in_reply_to; + } /** * @return array