From 3f4521bcf4b538b6ac54817cfad22b51e347546d Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 17 Jun 2015 03:03:03 -0400
Subject: [PATCH] Fix so plain text signature field uses monospace font (#1490435)

---
 program/lib/Roundcube/rcube_imap_cache.php |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/program/lib/Roundcube/rcube_imap_cache.php b/program/lib/Roundcube/rcube_imap_cache.php
index 6ba6b8b..81df076 100644
--- a/program/lib/Roundcube/rcube_imap_cache.php
+++ b/program/lib/Roundcube/rcube_imap_cache.php
@@ -571,7 +571,6 @@
             ." WHERE `user_id` = ?"
                 ." AND `mailbox` = ?"
                 .(!empty($uids) ? " AND `uid` IN (".$this->db->array2list($uids, 'integer').")" : "")
-                ." AND (`flags` & $idx) ".($enabled ? "= 0" : "= $idx"),
                 ." AND " . sprintf($binary_check, $idx) . ($enabled ? " = 0" : " = $idx"),
             $this->userid, $mailbox);
     }
@@ -1246,13 +1245,15 @@
     private function message_object_prepare(&$msg, &$size = 0)
     {
         // Remove body too big
-        if ($msg->body && ($length = strlen($msg->body))) {
-            $size += $length;
+        if (isset($msg->body)) {
+            $length = strlen($msg->body);
 
-            if ($size > $this->threshold * 1024) {
-                $size -= $length;
+            if ($msg->body_modified || $size + $length > $this->threshold * 1024) {
                 unset($msg->body);
             }
+            else {
+                $size += $length;
+            }
         }
 
         // Fix mimetype which might be broken by some code when message is displayed

--
Gitblit v1.9.1