diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-12-13 15:14:56 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-12-13 15:14:56 +0100 |
commit | a9bb50d8045e5a119ca5f66ec03753ca80aa4d4a (patch) | |
tree | bfa0822cf308f45d8ef602ed11f1dd0902823c30 /program/steps/mail/compose.inc | |
parent | 04689fa7ee89c29b57278a354b39d9ee5397a442 (diff) |
Fix handling of signatures on draft edit: Don't add new signature
and don't remove the old-one, the same for Edit as new (#1488798)
Diffstat (limited to 'program/steps/mail/compose.inc')
-rw-r--r-- | program/steps/mail/compose.inc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index d764f5289..b4dbd8d9c 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -169,14 +169,15 @@ else if ($msg_uid = $COMPOSE['param']['uid']) { } $config_show_sig = $RCMAIL->config->get('show_sig', 1); -if ($config_show_sig == 1) +if ($compose_mode == RCUBE_COMPOSE_EDIT || $compose_mode == RCUBE_COMPOSE_DRAFT) { + // don't add signature in draft/edit mode, we'll also not remove the old-one +} +else if ($config_show_sig == 1) $OUTPUT->set_env('show_sig', true); -else if ($config_show_sig == 2 && (empty($compose_mode) || $compose_mode == RCUBE_COMPOSE_EDIT || $compose_mode == RCUBE_COMPOSE_DRAFT)) +else if ($config_show_sig == 2 && empty($compose_mode)) $OUTPUT->set_env('show_sig', true); else if ($config_show_sig == 3 && ($compose_mode == RCUBE_COMPOSE_REPLY || $compose_mode == RCUBE_COMPOSE_FORWARD)) $OUTPUT->set_env('show_sig', true); -else - $OUTPUT->set_env('show_sig', false); // set line length for body wrapping $LINE_LENGTH = $RCMAIL->config->get('line_length', 72); @@ -741,8 +742,10 @@ function rcmail_compose_part_body($part, $isHtml = false) } else { // try to remove the signature - if ($RCMAIL->config->get('strip_existing_sig', true)) { - $body = rcmail_remove_signature($body); + if ($compose_mode != RCUBE_COMPOSE_DRAFT && $compose_mode != RCUBE_COMPOSE_EDIT) { + if ($RCMAIL->config->get('strip_existing_sig', true)) { + $body = rcmail_remove_signature($body); + } } // add HTML formatting $body = rcmail_plain_body($body); @@ -773,8 +776,10 @@ function rcmail_compose_part_body($part, $isHtml = false) } // try to remove the signature - if ($RCMAIL->config->get('strip_existing_sig', true)) { - $body = rcmail_remove_signature($body); + if ($compose_mode != RCUBE_COMPOSE_DRAFT && $compose_mode != RCUBE_COMPOSE_EDIT) { + if ($RCMAIL->config->get('strip_existing_sig', true)) { + $body = rcmail_remove_signature($body); + } } } } |