summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-10-27 10:41:40 +0000
committeralecpl <alec@alec.pl>2008-10-27 10:41:40 +0000
commit2855518f1d189a715cf79b1e2c944e9b5dcd539f (patch)
treeb6d504149d3497e004e01763f9c26764dbf1d591 /program/steps
parent11b1b16b2fa855eab6c03b69c41a38a423332a27 (diff)
- Fix unread message unintentionally marked as read if read_when_deleted=true (#1485409)
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/move_del.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc
index c8db35b29..7dd4489b8 100644
--- a/program/steps/mail/move_del.inc
+++ b/program/steps/mail/move_del.inc
@@ -28,6 +28,11 @@ if ($RCMAIL->action=='moveto' && !empty($_POST['_uid']) && !empty($_POST['_targe
$count = sizeof(explode(',', ($uids = get_input_value('_uid', RCUBE_INPUT_POST))));
$target = get_input_value('_target_mbox', RCUBE_INPUT_POST);
$mbox = get_input_value('_mbox', RCUBE_INPUT_POST);
+
+ // flag messages as read before moving them
+ if ($CONFIG['read_when_deleted'])
+ $IMAP->set_flag($uids, 'SEEN');
+
$moved = $IMAP->move_message($uids, $target, $mbox);
if (!$moved) {
@@ -38,10 +43,6 @@ if ($RCMAIL->action=='moveto' && !empty($_POST['_uid']) && !empty($_POST['_targe
exit;
}
- // flag old messages as read because rcube_imap will not send expunge command after moving
- if ($CONFIG['read_when_deleted'])
- $IMAP->set_flag($uids, 'SEEN');
-
if (!$CONFIG['flag_for_deletion'])
$addrows = true;
}