Fix duplicate messages on the list after deleting messages on the next to the last page (#5862)

... also when deleting via 'mark' and 'archive' actions
pull/5890/head
Aleksander Machniak 7 years ago
parent 74e7f90673
commit 02c7c9fc53

@ -291,8 +291,11 @@ class archive extends rcube_plugin
// add new rows from next page (if any)
if ($addrows && $count && $uids != '*' && ($jump_back || $nextpage_count > 0)) {
// #5862: Don't add more rows than it was on the next page
$count = $jump_back ? null : min($nextpage_count, $count);
$a_headers = $storage->list_messages($mbox, null,
rcmail_sort_column(), rcmail_sort_order(), $jump_back ? null : $count);
rcmail_sort_column(), rcmail_sort_order(), $count);
rcmail_js_message_list($a_headers, false);
}

@ -158,8 +158,11 @@ if ($_uids && $flag) {
// add new rows from next page (if any)
if ($old_count && $_uids != '*' && ($jump_back || $nextpage_count > 0)) {
$a_headers = $RCMAIL->storage->list_messages($mbox, NULL,
rcmail_sort_column(), rcmail_sort_order(), $jump_back ? NULL : $count);
// #5862: Don't add more rows than it was on the next page
$count = $jump_back ? null : min($nextpage_count, $count);
$a_headers = $RCMAIL->storage->list_messages($mbox, null,
rcmail_sort_column(), rcmail_sort_order(), $count);
rcmail_js_message_list($a_headers, false);
}

Loading…
Cancel
Save