Skip to content

Commit

Permalink
fixup! improve message preview
Browse files Browse the repository at this point in the history
  • Loading branch information
st3iny committed Mar 23, 2023
1 parent 28c7514 commit a2c8033
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/IMAP/MessageMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,7 @@ public function getBodyStructureData(Horde_Imap_Client_Socket $client,
$structure->setContents($textBody);
$textBody = $structure->getContents();
}
$html = new Html2Text($htmlBody);
return new MessageStructureData($hasAttachments, trim($html->getText()), $isImipMessage);
return new MessageStructureData($hasAttachments, $textBody, $isImipMessage);
}

$htmlBody = ($htmlBodyId !== null) ? $part->getBodyPart($htmlBodyId) : null;
Expand All @@ -746,9 +745,10 @@ public function getBodyStructureData(Horde_Imap_Client_Socket $client,
$structure->setContents($htmlBody);
$htmlBody = $structure->getContents();
}
return new MessageStructureData($hasAttachments, $textBody, $isImipMessage);
// TODO: add 'alt_image' => 'hide' once it's added to the Html2Text package
$html = new Html2Text($htmlBody, array('do_links' => 'none',));
return new MessageStructureData($hasAttachments, trim($html->getText()), $isImipMessage);
}

return new MessageStructureData($hasAttachments, $text, $isImipMessage);
}, iterator_to_array($structures->getIterator()));
}
Expand Down

0 comments on commit a2c8033

Please sign in to comment.