Skip to content

Commit

Permalink
support message delivery status (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
eidng8 authored and Webklex committed Mar 15, 2018
1 parent 1683aeb commit 829b2a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/IMAP/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ private function fetchStructure($structure, $partNumber = null) {
*/
protected function fetchAttachment($structure, $partNumber){
switch ($structure->type) {
case self::TYPE_MESSAGE:
$type = 'message';
break;
case self::TYPE_APPLICATION:
$type = 'application';
break;
Expand Down Expand Up @@ -476,6 +479,13 @@ protected function fetchAttachment($structure, $partNumber){
}
}
}
if(self::TYPE_MESSAGE == $structure->type) {
if($structure->ifdescription) {
$attachment->name = $structure->description;
} else {
$attachment->name = $structure->subtype;
}
}

if (!$attachment->name && property_exists($structure, 'parameters')) {
foreach ($structure->parameters as $parameter) {
Expand Down

0 comments on commit 829b2a1

Please sign in to comment.