From: Michael M Slusarz Date: Thu, 30 Sep 2010 17:47:06 +0000 (-0600) Subject: Fix forwarding in dimp if only forwarding one message X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=687c73d6c0078fe9f2181a5b9f2e86e69ed68d43;p=horde.git Fix forwarding in dimp if only forwarding one message --- diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index e705678bf..7b6d7d0bc 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -111,7 +111,11 @@ case 'forward_attach': case 'forward_auto': case 'forward_body': case 'forward_both': - if ($vars->uids) { + $indices = $vars->uids + ? new IMP_Indices($vars->uids) + : null; + + if ($indices && (count($indices) > 1)) { if (!in_array($vars->type, array('forward_attach', 'forward_auto'))) { $notification->push(_("Multiple messages can only be forwarded as attachments."), 'horde.warning'); } @@ -128,13 +132,12 @@ case 'forward_both': $rte = $show_editor = ($prefs->getValue('compose_html') && $_SESSION['imp']['rteavail']); } else { - - try { - $contents = $imp_ui->getContents($vars); - } catch (IMP_Compose_Exception $e) { - $notification->push($e, 'horde.error'); - break; - } + try { + $contents = $imp_ui->getContents($vars); + } catch (IMP_Compose_Exception $e) { + $notification->push($e, 'horde.error'); + break; + } $fwd_msg = $imp_compose->forwardMessage($vars->type, $contents); $msg = $fwd_msg['body']; diff --git a/imp/lib/Ui/Compose.php b/imp/lib/Ui/Compose.php index 70d657f66..50270074c 100644 --- a/imp/lib/Ui/Compose.php +++ b/imp/lib/Ui/Compose.php @@ -227,6 +227,8 @@ class IMP_Ui_Compose } elseif ($vars->folder && $vars->uid) { /* DIMP: compose-dimp.php */ $indices = new IMP_Indices($vars->folder, $vars->uid); + } elseif ($vars->uids) { + $indices = new IMP_Indices($vars->uids); } if (!is_null($indices)) {