Skip to content

Commit

Permalink
Short circuit the content decoding if it was already done server side.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jun 5, 2015
1 parent cc36df0 commit 9d4c932
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -522,6 +522,13 @@ public function fetchBodypart($folder, $uid, $id)
$query,
array('ids' => new Horde_Imap_Client_Ids($uid))
);

// Already decoded?
if ($ret[$uid]->getBodyPartDecode($id)) {
return $ret[$uid]->getBodyPart($id, true);
}

// Not already decoded, let Horde_Mime do it.
$part = $ret[$uid]->getStructure()->getPart($id);
$part->setContents(
$ret[$uid]->getBodyPart($id, true),
Expand Down

0 comments on commit 9d4c932

Please sign in to comment.