Skip to content

Commit

Permalink
Update Message.php (#56)
Browse files Browse the repository at this point in the history
Enable support to get In-Reply-To property from Message header.
  • Loading branch information
tiacardoso authored and Webklex committed Feb 14, 2018
1 parent 304bfc1 commit 1b01853
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/IMAP/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand All @@ -80,6 +81,7 @@ class Message {
public $cc = [];
public $bcc = [];
public $reply_to = [];
public $in_reply_to = '';
public $sender = [];

/**
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1b01853

Please sign in to comment.