Skip to content

Commit 1b01853

Browse files
tiacardosoWebklex
authored andcommitted
Update Message.php (#56)
Enable support to get In-Reply-To property from Message header.
1 parent 304bfc1 commit 1b01853

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/IMAP/Message.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class Message {
6969
* @var array $cc
7070
* @var array $bcc
7171
* @var array $reply_to
72+
* @var string $in_reply_to
7273
* @var array $sender
7374
*/
7475
public $message_id = '';
@@ -80,6 +81,7 @@ class Message {
8081
public $cc = [];
8182
public $bcc = [];
8283
public $reply_to = [];
84+
public $in_reply_to = '';
8385
public $sender = [];
8486

8587
/**
@@ -284,6 +286,9 @@ private function parseHeader() {
284286
if (property_exists($header, 'reply_to')) {
285287
$this->reply_to = $this->parseAddresses($header->reply_to);
286288
}
289+
if (property_exists($header, 'in_reply_to')) {
290+
$this->in_reply_to = str_replace(['<', '>'], '', $header->in_reply_to);
291+
}
287292
if (property_exists($header, 'sender')) {
288293
$this->sender = $this->parseAddresses($header->sender);
289294
}
@@ -745,6 +750,13 @@ public function getBcc() {
745750
public function getReplyTo() {
746751
return $this->reply_to;
747752
}
753+
754+
/**
755+
* @return string
756+
*/
757+
public function getInReplyTo() {
758+
return $this->in_reply_to;
759+
}
748760

749761
/**
750762
* @return array

0 commit comments

Comments
 (0)