Prevent from ghost messages on list after fast delete of multiple messages one-by-one (#5941)

pull/6072/head
Aleksander Machniak 7 years ago
parent c1d282ec54
commit 6113300676

@ -2070,6 +2070,11 @@ function rcube_webmail()
if (flags.mbox != this.env.mailbox && !flags.skip_mbox_check)
return false;
// When deleting messages fast it may happen that the same message
// from the next page could be added many times, we prevent this here
if (this.message_list.rows[uid])
return false;
if (!this.env.messages[uid])
this.env.messages[uid] = {};
@ -2827,13 +2832,14 @@ function rcube_webmail()
// update thread indicators for all messages in a thread below the specified message
// return number of removed/added root level messages
this.update_thread = function (uid)
this.update_thread = function(uid)
{
if (!this.env.threading)
if (!this.env.threading || !this.message_list.rows[uid])
return 0;
var r, parent, count = 0,
rows = this.message_list.rows,
list = this.message_list,
rows = list.rows,
row = rows[uid],
depth = rows[uid].depth,
roots = [];
@ -2843,14 +2849,14 @@ function rcube_webmail()
// update unread_children for thread root
if (row.depth && row.unread) {
parent = this.message_list.find_root(uid);
parent = list.find_root(uid);
rows[parent].unread_children--;
this.set_unread_children(parent);
}
// update unread_children for thread root
if (row.depth && row.flagged) {
parent = this.message_list.find_root(uid);
parent = list.find_root(uid);
rows[parent].flagged_children--;
this.set_flagged_children(parent);
}

@ -487,8 +487,9 @@ function rcmail_js_message_list($a_headers, $insert_top=false, $a_show_cols=null
// loop through message headers
foreach ($a_headers as $header) {
if (empty($header))
if (empty($header) || !$header->size) {
continue;
}
// make message UIDs unique by appending the folder name
if ($multifolder) {

Loading…
Cancel
Save