Markasjunk: Fix bug where marking as spam/ham didn't work on moving messages with drag-and-drop (#7137)

pull/7195/head
Aleksander Machniak 5 years ago
parent 6c1e8e1efe
commit c6392f2168

@ -14,6 +14,7 @@ CHANGELOG Roundcube Webmail
- Enigma: Fix so using list checkbox selection does not load the key preview frame - Enigma: Fix so using list checkbox selection does not load the key preview frame
- Enigma: Fix generation of key pairs for identities with IDN domains (#7181) - Enigma: Fix generation of key pairs for identities with IDN domains (#7181)
- Enigma: Display IDN domains of key users and identities in UTF8 - Enigma: Display IDN domains of key users and identities in UTF8
- Markasjunk: Fix bug where marking as spam/ham didn't work on moving messages with drag-and-drop (#7137)
- Password: Make chpass-wrapper.py Python 3 compatible (#7135) - Password: Make chpass-wrapper.py Python 3 compatible (#7135)
- Elastic: Fix disappearing sidebar in mail compose after clicking Mail button - Elastic: Fix disappearing sidebar in mail compose after clicking Mail button
- Elastic: Fix incorrect aria-disabled attribute on Mail taskmenu button in mail compose - Elastic: Fix incorrect aria-disabled attribute on Mail taskmenu button in mail compose

@ -102,8 +102,11 @@ class markasjunk_cmd_learn
$output = shell_exec($tmp_command); $output = shell_exec($tmp_command);
if ($debug) { if ($debug) {
if ($output) {
$tmp_command .= "\n$output";
}
rcube::write_log('markasjunk', $tmp_command); rcube::write_log('markasjunk', $tmp_command);
rcube::write_log('markasjunk', $output);
} }
if (strpos($command, '%f') !== false) { if (strpos($command, '%f') !== false) {

@ -111,17 +111,22 @@ if (window.rcmail) {
rcmail.addEventListener('listupdate', function() { rcmail.markasjunk_toggle_button(); }); rcmail.addEventListener('listupdate', function() { rcmail.markasjunk_toggle_button(); });
rcmail.addEventListener('beforemoveto', function(mbox) { rcmail.addEventListener('beforemove', function(mbox) {
if (mbox && typeof mbox === 'object') if (mbox && typeof mbox === 'object') {
mbox = mbox.id; mbox = mbox.id;
}
if (!mbox) {
return;
}
var is_spam = null; var is_spam = null;
// check if destination mbox equals junk box (and we're not already in the junk box) // check if destination mbox equals junk box (and we're not already in the junk box)
if (rcmail.env.markasjunk_move_spam && mbox && mbox == rcmail.env.markasjunk_spam_mailbox && mbox != rcmail.env.mailbox) if (rcmail.env.markasjunk_move_spam && mbox == rcmail.env.markasjunk_spam_mailbox && mbox != rcmail.env.mailbox)
is_spam = true; is_spam = true;
// or if destination mbox equals ham box and we are in the junk box // or if destination mbox equals ham box and we are in the junk box
else if (rcmail.env.markasjunk_move_ham && mbox && mbox == rcmail.env.markasjunk_ham_mailbox && rcmail.env.mailbox == rcmail.env.markasjunk_spam_mailbox) else if (rcmail.env.markasjunk_move_ham && mbox == rcmail.env.markasjunk_ham_mailbox && rcmail.env.mailbox == rcmail.env.markasjunk_spam_mailbox)
is_spam = false; is_spam = false;
if (is_spam !== null) { if (is_spam !== null) {

Loading…
Cancel
Save