summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--program/steps/mail/mark.inc6
-rw-r--r--program/steps/mail/move_del.inc5
3 files changed, 8 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 30fe24ec7..f67ca34db 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
+- Fix deleting all messages from last list page (#1486293)
- Flag original messages when sending a draft (#1486203)
- Changed signature separator when top-posting (#1486330)
- Let the admin define defaults for search modifiers (#1485897)
diff --git a/program/steps/mail/mark.inc b/program/steps/mail/mark.inc
index 014108ffc..3e0ee9ecb 100644
--- a/program/steps/mail/mark.inc
+++ b/program/steps/mail/mark.inc
@@ -81,7 +81,7 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va
$remaining = $msg_count - $IMAP->page_size * ($IMAP->list_page - 1);
// jump back one page (user removed the whole last page)
- if ($IMAP->list_page > 1 && $nextpage_count <= 0 && $remaining == 0) {
+ if ($IMAP->list_page > 1 && $remaining == 0) {
$IMAP->set_page($IMAP->list_page-1);
$_SESSION['page'] = $IMAP->list_page;
$jump_back = true;
@@ -96,6 +96,7 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va
$mbox = $IMAP->get_mailbox_name();
$unseen_count = $msg_count ? $IMAP->messagecount($mbox, 'UNSEEN') : 0;
$old_unseen = $_SESSION['unseen_count'][$mbox];
+
if ($old_unseen != $unseen_count) {
$OUTPUT->command('set_unread_count', $mbox, $unseen_count, ($mbox == 'INBOX'));
$_SESSION['unseen_count'][$mbox] = $unseen_count;
@@ -107,7 +108,8 @@ if (($uids = get_input_value('_uid', RCUBE_INPUT_POST)) && ($flag = get_input_va
$sort_col = isset($_SESSION['sort_col']) ? $_SESSION['sort_col'] : $CONFIG['message_sort_col'];
$sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order'];
- $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order, $count);
+ $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order,
+ $jump_back ? NULL : $count);
rcmail_js_message_list($a_headers, false, false);
}
diff --git a/program/steps/mail/move_del.inc b/program/steps/mail/move_del.inc
index 2895867e3..b8bd16557 100644
--- a/program/steps/mail/move_del.inc
+++ b/program/steps/mail/move_del.inc
@@ -88,7 +88,7 @@ else
$remaining = $msg_count - $IMAP->page_size * ($IMAP->list_page - 1);
// jump back one page (user removed the whole last page)
- if ($IMAP->list_page > 1 && $nextpage_count <= 0 && $remaining == 0) {
+ if ($IMAP->list_page > 1 && $remaining == 0) {
$IMAP->set_page($IMAP->list_page-1);
$_SESSION['page'] = $IMAP->list_page;
$jump_back = true;
@@ -121,7 +121,8 @@ else
$sort_col = isset($_SESSION['sort_col']) ? $_SESSION['sort_col'] : $CONFIG['message_sort_col'];
$sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order'];
- $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order, $count);
+ $a_headers = $IMAP->list_headers($mbox, NULL, $sort_col, $sort_order,
+ $jump_back ? NULL : $count);
rcmail_js_message_list($a_headers, false, false);
}