From 2965a981b7ec22866fbdf2d567d87e2d068d3617 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Fri, 31 Jul 2015 16:04:08 -0400
Subject: [PATCH] Allow to search and import missing PGP pubkeys from keyservers using Publickey.js

---
 program/steps/mail/mark.inc |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/program/steps/mail/mark.inc b/program/steps/mail/mark.inc
index 50243c6..4e83f97 100644
--- a/program/steps/mail/mark.inc
+++ b/program/steps/mail/mark.inc
@@ -4,7 +4,7 @@
  | program/steps/mail/mark.inc                                           |
  |                                                                       |
  | This file is part of the Roundcube Webmail client                     |
- | Copyright (C) 2005-2013, The Roundcube Dev Team                       |
+ | Copyright (C) 2005-2014, The Roundcube Dev Team                       |
  |                                                                       |
  | Licensed under the GNU General Public License version 3 or            |
  | any later version with exceptions for skins & plugins.                |
@@ -47,7 +47,7 @@
         $old_pages = ceil($old_count / $RCMAIL->storage->get_pagesize());
     }
 
-    foreach (rcmail_get_uids() as $mbox => $uids) {
+    foreach (rcmail::get_uids() as $mbox => $uids) {
         $marked += (int)$RCMAIL->storage->set_flag($uids, $flag, $mbox);
         $count += count($uids);
     }
@@ -68,7 +68,9 @@
 
     if ($flag == 'DELETED' && $read_deleted && !empty($_POST['_ruid'])) {
         $ruids = rcube_utils::get_input_value('_ruid', rcube_utils::INPUT_POST);
-        $read  = $RCMAIL->storage->set_flag($ruids, 'SEEN');
+        foreach (rcmail::get_uids($ruids) as $mbox => $uids) {
+            $read += (int)$RCMAIL->storage->set_flag($uids, 'SEEN', $mbox);
+        }
 
         if ($read && !$skip_deleted) {
             $OUTPUT->command('flag_deleted_as_read', $ruids);
@@ -76,7 +78,9 @@
     }
 
     if ($flag == 'SEEN' || $flag == 'UNSEEN' || ($flag == 'DELETED' && !$skip_deleted)) {
-        rcmail_send_unread_count($RCMAIL->storage->get_folder());
+        foreach (rcmail::get_uids() as $mbox => $uids) {
+            rcmail_send_unread_count($mbox);
+        }
     }
     else if ($flag == 'DELETED' && $skip_deleted) {
         if ($_POST['_from'] == 'show') {

--
Gitblit v1.9.1