From fc52af24f1418d6590a2d37a0d8cc31b123e38f6 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Tue, 19 Aug 2014 12:08:35 -0400
Subject: [PATCH] Fix merge error that disabled contact drag'n'drop

---
 program/steps/mail/show.inc |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index b01989a..c1726bb 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -157,9 +157,9 @@
         $ol .= html::tag('li', null, Q(sprintf("%s (%s)", $filename, $size)));
       }
       else {
-        if (mb_strlen($filename) > 50) {
+        if ($attrib['maxlength'] && mb_strlen($filename) > $attrib['maxlength']) {
           $title    = $filename;
-          $filename = abbreviate_string($filename, 50);
+          $filename = abbreviate_string($filename, $attrib['maxlength']);
         }
         else {
           $title = '';
@@ -173,6 +173,7 @@
               JS_OBJECT_NAME,
               $attach_prop->mime_id,
               rcmail_fix_mimetype($attach_prop->mimetype)),
+              'onmouseover' => $title ? '' : 'rcube_webmail.long_subject_title_ex(this, 0)',
               'title' => Q($title),
             ),
             Q($filename)));
@@ -255,9 +256,13 @@
   if ($email) {
     // @TODO: search in all address books?
     $CONTACTS = $RCMAIL->get_address_book(-1, true);
-    $existing = $CONTACTS->search('email', $email, true, false);
-    if ($existing->count)
-      return true;
+
+    if (is_object($CONTACTS)) {
+      $existing = $CONTACTS->search('email', $email, true, false);
+      if ($existing->count) {
+        return true;
+      }
+    }
   }
 
   return false;

--
Gitblit v1.9.1