summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-05-31 07:38:56 +0000
committeralecpl <alec@alec.pl>2011-05-31 07:38:56 +0000
commit340546c975bca94526a3e16039895a6d0600828b (patch)
tree06d6256f1f444557068e107128575d775e447924 /program/steps/mail/sendmail.inc
parent644e3ad91250c0cb7b291b48e3b5cef401bffd90 (diff)
- Optimization for spellcheck_before_send: don't invoke new ajax request. While we already have mispellings, we can return them and enable spellchecker directly without querying the server again
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 80543041a..91d71a74f 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -411,7 +411,7 @@ if (!$savedraft) {
// Check spelling before send
if ($CONFIG['spellcheck_before_send'] && $CONFIG['enable_spellcheck']
- && empty($_SESSION['compose']['spell_checked'])
+ && empty($_SESSION['compose']['spell_checked']) && !empty($message_body)
) {
$spellchecker = new rcube_spellchecker(get_input_value('_lang', RCUBE_INPUT_GPC));
$spell_result = $spellchecker->check($message_body, $isHtml);
@@ -419,8 +419,9 @@ if (!$savedraft) {
$_SESSION['compose']['spell_checked'] = true;
if (!$spell_result) {
+ $result = $isHtml ? $spellchecker->get_words() : $spellchecker->get_xml();
$OUTPUT->show_message('mispellingsfound', 'error');
- $OUTPUT->command('command', 'spellcheck');
+ $OUTPUT->command('spellcheck_resume', $isHtml, $result);
$OUTPUT->send('iframe');
}
}