$show_editor = false;
$title = _("New Message");
-if (in_array($type, array('reply', 'reply_all', 'reply_list', 'forward', 'resume'))) {
+if (in_array($type, array('reply', 'reply_all', 'reply_auto', 'reply_list', 'forward', 'resume'))) {
if (!$uid || !$folder) {
$type = 'new';
}
switch ($type) {
case 'reply':
case 'reply_all':
+case 'reply_auto':
case 'reply_list':
$reply_msg = $imp_compose->replyMessage($type, $imp_contents, Horde_Util::getFormData('to'));
$msg = $reply_msg['body'];
$header = $reply_msg['headers'];
$header['replytype'] = 'reply';
+ $type = $reply_msg['type'];
if ($type == 'reply') {
$title = _("Reply:");
/**
* Determines the reply text and headers for a message.
*
- * @param string $actionID The reply action (reply, reply_all,
- * reply_list or *).
+ * @param string $type The reply type (reply, reply_all,
+ * reply_auto, reply_list, or *).
* @param IMP_Contents $contents An IMP_Contents object.
* @param string $to The recipient of the reply. Overrides
* the automatically determined value.
* message's addresses.
* </pre>
*/
- public function replyMessage($actionID, $contents, $to = null)
+ public function replyMessage($type, $contents, $to = null)
{
global $prefs;
$h = $contents->getHeaderOb();
$match_identity = $this->_getMatchingIdentity($h);
+ $reply_type = 'reply';
$this->_metadata['mailbox'] = $contents->getMailbox();
$this->_metadata['reply_type'] = 'reply';
? 'Re: '
: 'Re: ' . $GLOBALS['imp_imap']->ob()->utils->getBaseSubject($subject, array('keepblob' => true));
- if (in_array($actionID, array('reply', '*'))) {
+ if (in_array($type, array('reply', 'reply_auto', '*'))) {
($header['to'] = $to) ||
($header['to'] = Horde_Mime_Address::addrArray2String($h->getOb('reply-to'))) ||
($header['to'] = Horde_Mime_Address::addrArray2String($h->getOb('from')));
- if ($actionID == '*') {
+ if ($type == '*') {
$all_headers['reply'] = $header;
}
}
- if (in_array($actionID, array('reply_all', '*'))) {
+ if (in_array($type, array('reply_all', '*'))) {
/* Filter out our own address from the addresses we reply to. */
$identity = Identity::singleton(array('imp', 'imp'));
$all_addrs = array_keys($identity->getAllFromAddresses(true));
/* Build the Bcc: header. */
$header['bcc'] = Horde_Mime_Address::addrArray2String($h->getOb('bcc') + $identity->getBccAddresses(), array('filter' => $all_addrs));
- if ($actionID == '*') {
+ if ($type == '*') {
$all_headers['reply_all'] = $header;
}
+
+ $reply_type = 'reply_all';
}
- if (in_array($actionID, array('reply_list', '*'))) {
+ if (in_array($type, array('reply_auto', 'reply_list', '*'))) {
$imp_ui = new IMP_UI_Message();
$list_info = $imp_ui->getListInformation($h);
if ($list_info['exists']) {
$header['to'] = $list_info['reply_list'];
- if ($actionID == '*') {
+ if ($type == '*') {
$all_headers['reply_list'] = $header;
}
}
+
+ $reply_type = 'reply_list';
}
- if ($actionID == '*') {
+ if ($type == '*') {
$header = $all_headers;
}
if (!$prefs->getValue('reply_quote')) {
return array(
'body' => '',
- 'headers' => $header,
'format' => 'text',
- 'identity' => $match_identity
+ 'headers' => $header,
+ 'identity' => $match_identity,
+ 'type' => $reply_type
);
}
return array(
'body' => $msg . "\n",
'encoding' => $msg_text['encoding'],
- 'headers' => $header,
'format' => $msg_text['mode'],
- 'identity' => $match_identity
+ 'headers' => $header,
+ 'identity' => $match_identity,
+ 'type' => $reply_type
);
}
$disable_compose = !IMP::canCompose();
if (!$disable_compose) {
- $a_template->set('reply', Horde::widget(IMP::composeLink(array(), array('actionID' => 'reply') + $compose_params), _("Reply"), 'widget hasmenu', '', '', _("_Reply"), true));
+ $a_template->set('reply', Horde::widget(IMP::composeLink(array(), array('actionID' => 'reply_auto') + $compose_params), _("Reply"), 'widget hasmenu', '', '', _("_Reply"), true));
$a_template->set('reply_sender', Horde::widget(IMP::composeLink(array(), array('actionID' => 'reply') + $compose_params), _("To Sender"), 'widget', '', '', _("To Sender"), true));
if ($list_info['reply_list']) {