From 687c73d6c0078fe9f2181a5b9f2e86e69ed68d43 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 30 Sep 2010 11:47:06 -0600 Subject: [PATCH] Fix forwarding in dimp if only forwarding one message --- imp/compose-dimp.php | 19 +++++++++++-------- imp/lib/Ui/Compose.php | 2 ++ 2 files changed, 13 insertions(+), 8 deletions(-) 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)) { -- 2.11.0