From 814905ca879d976792f33cf0fb45a4d3f8fedc32 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 09 Apr 2010 04:38:20 -0400
Subject: [PATCH] Let plugins modify the Sent folder when composing (#1486548)

---
 program/steps/mail/compose.inc |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index bf24503..658f590 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -55,9 +55,12 @@
     }
   }
   
+  // select folder where to save the sent message
+  $_SESSION['compose']['param']['sent_mbox'] = $RCMAIL->config->get('sent_mbox');
+  
   // pipe compose parameters thru plugins
   $plugin = $RCMAIL->plugins->exec_hook('message_compose', $_SESSION['compose']);
-  $_SESSION['compose']['param'] = array_merge($_SESSION['compose']['param'], $plugin['param']);   
+  $_SESSION['compose']['param'] = array_merge($_SESSION['compose']['param'], $plugin['param']);
 
   // add attachments listed by message_compose hook
   if (is_array($plugin['attachments'])) {
@@ -1061,7 +1064,7 @@
 {
   $attrib['name'] = '_store_target';
   $select = rcmail_mailbox_select(array_merge($attrib, array('noselection' => '- '.rcube_label('dontsave').' -')));
-  return $select->show(rcmail::get_instance()->config->get('sent_mbox'), $attrib);
+  return $select->show($_SESSION['compose']['param']['sent_mbox'], $attrib);
 }
 
 

--
Gitblit v1.9.1