Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric Kastner committed Sep 5, 2018
1 parent c640425 commit 2f4451d
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/Fetch/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,33 +228,39 @@ protected function loadMessage()
{

/* First load the message overview information */

if(!is_object($messageOverview = $this->getOverview()))

if(!is_object($messageOverview = $this->getOverview())) {
return false;

$this->subject = MIME::decode($messageOverview->subject, self::$charset);
}

if (isset($messageOverview->subject)) {
$this->subject = MIME::decode($messageOverview->subject, self::$charset);
}

$this->date = strtotime($messageOverview->date);
$this->size = $messageOverview->size;

foreach (self::$flagTypes as $flag)
foreach (self::$flagTypes as $flag) {
$this->status[$flag] = ($messageOverview->$flag == 1);
}

/* Next load in all of the header information */

$headers = $this->getHeaders();

if (isset($headers->to))
if (isset($headers->to)) {
$this->to = $this->processAddressObject($headers->to);
}

if (isset($headers->cc))
if (isset($headers->cc)) {
$this->cc = $this->processAddressObject($headers->cc);
}

if (isset($headers->bcc))
if (isset($headers->bcc)) {
$this->bcc = $this->processAddressObject($headers->bcc);
}

if (isset($headers->sender))
if (isset($headers->sender)) {
$this->sender = $this->processAddressObject($headers->sender);
}

$this->from = isset($headers->from) ? $this->processAddressObject($headers->from) : array('');
$this->replyTo = isset($headers->reply_to) ? $this->processAddressObject($headers->reply_to) : $this->from;
Expand Down

0 comments on commit 2f4451d

Please sign in to comment.