Skip to content

Commit

Permalink
Fix duplicate messages on the list after deleting messages on the nex…
Browse files Browse the repository at this point in the history
…t to the last page (#5862)

... also when deleting via 'mark' and 'archive' actions
  • Loading branch information
alecpl committed Jul 17, 2017
1 parent 74e7f90 commit 02c7c9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion plugins/archive/archive.php
Expand Up @@ -291,8 +291,11 @@ function move_messages()

// 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);
}
Expand Down
7 changes: 5 additions & 2 deletions program/steps/mail/mark.inc
Expand Up @@ -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);
}
Expand Down

0 comments on commit 02c7c9f

Please sign in to comment.