From 0344b168276f80189e2254c75a762aff5b517b6b Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 22 May 2016 06:32:57 -0400
Subject: [PATCH] Fix priority icon(s) position

---
 program/lib/Roundcube/rcube_cache.php |   23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/program/lib/Roundcube/rcube_cache.php b/program/lib/Roundcube/rcube_cache.php
index c74c50c..fb1d5e1 100644
--- a/program/lib/Roundcube/rcube_cache.php
+++ b/program/lib/Roundcube/rcube_cache.php
@@ -1,6 +1,6 @@
 <?php
 
-/*
+/**
  +-----------------------------------------------------------------------+
  | This file is part of the Roundcube Webmail client                     |
  | Copyright (C) 2011, The Roundcube Dev Team                            |
@@ -17,7 +17,6 @@
  | Author: Aleksander Machniak <alec@alec.pl>                            |
  +-----------------------------------------------------------------------+
 */
-
 
 /**
  * Interface class for accessing Roundcube cache
@@ -92,7 +91,6 @@
         $this->prefix    = $prefix;
     }
 
-
     /**
      * Returns cached value.
      *
@@ -109,7 +107,6 @@
         return $this->cache[$key];
     }
 
-
     /**
      * Sets (add/update) value in cache.
      *
@@ -121,7 +118,6 @@
         $this->cache[$key]         = $data;
         $this->cache_changes[$key] = true;
     }
-
 
     /**
      * Returns cached value without storing it in internal memory.
@@ -139,7 +135,6 @@
         return $this->read_record($key, true);
     }
 
-
     /**
      * Sets (add/update) value in cache and immediately saves
      * it in the backend, no internal memory will be used.
@@ -153,7 +148,6 @@
     {
         return $this->write_record($key, $this->serialize($data));
     }
-
 
     /**
      * Clears the cache.
@@ -191,7 +185,6 @@
         $this->remove_record($key, $prefix_mode);
     }
 
-
     /**
      * Remove cache records older than ttl
      */
@@ -208,7 +201,6 @@
         }
     }
 
-
     /**
      * Remove expired records of all caches
      */
@@ -219,7 +211,6 @@
 
         $db->query("DELETE FROM " . $db->table_name('cache', true) . " WHERE `expires` < " . $db->now());
     }
-
 
     /**
      * Writes the cache back to the DB.
@@ -242,8 +233,10 @@
         if ($this->index_changed) {
             $this->write_index();
         }
-    }
 
+        // reset internal cache index, thanks to this we can force index reload
+        $this->index = null;
+    }
 
     /**
      * Reads cache entry.
@@ -330,7 +323,6 @@
         return $this->cache[$key];
     }
 
-
     /**
      * Writes single cache record into DB.
      *
@@ -408,7 +400,6 @@
         return $this->db->affected_rows($result);
     }
 
-
     /**
      * Deletes the cache record(s).
      *
@@ -473,7 +464,6 @@
             $this->userid);
     }
 
-
     /**
      * Adds entry into memcache/apc DB.
      *
@@ -506,7 +496,6 @@
         return $result;
     }
 
-
     /**
      * Deletes entry from memcache/apc DB.
      *
@@ -530,7 +519,6 @@
 
         return $result;
     }
-
 
     /**
      * Writes the index entry into memcache/apc DB.
@@ -561,7 +549,6 @@
         $this->add_record($this->ikey(), $data);
     }
 
-
     /**
      * Gets the index entry from memcache/apc DB.
      */
@@ -591,7 +578,6 @@
         $this->index = $data ? unserialize($data) : array();
     }
 
-
     /**
      * Creates per-user cache key name (for memcache and apc)
      *
@@ -603,7 +589,6 @@
     {
         return sprintf('%d:%s:%s', $this->userid, $this->prefix, $key);
     }
-
 
     /**
      * Creates per-user index cache key name (for memcache and apc)

--
Gitblit v1.9.1