summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/program/js/app.js b/program/js/app.js
index ec5fac3c2..fa78c24a8 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1525,12 +1525,16 @@ function rcube_webmail()
{
// mark all message rows as read/unread
var icn_src;
+ var res_uids = new Array();
var rows = this.message_list.rows;
for (var i=0; i<a_uids.length; i++)
{
uid = a_uids[i];
- if (rows[uid])
+ // check if flag isn't set yet
+ if (rows[uid] && ((flag=='unread' && !rows[uid].unread) || (flag=='read' && rows[uid].unread)))
{
+ res_uids[res_uids.length] = uid;
+
rows[uid].unread = (flag=='unread' ? true : false);
if (rows[uid].classname.indexOf('unread')<0 && rows[uid].unread)
@@ -1556,8 +1560,9 @@ function rcube_webmail()
rows[uid].icon.src = icn_src;
}
}
-
- this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag);
+
+ if (res_uids.length)
+ this.http_post('mark', '_uid='+res_uids.join(',')+'&_flag='+flag);
};
// mark all message rows as deleted/undeleted