From 7ae5432fbfc0e923f2fe8dc62ff77afb8ecc80cf Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Wed, 30 May 2012 04:42:27 -0400
Subject: [PATCH] Abbreviate long attachment file names with ellipsis (#1488499)

---
 program/include/rcube_plugin_api.php |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/program/include/rcube_plugin_api.php b/program/include/rcube_plugin_api.php
index e182ace..be12f11 100644
--- a/program/include/rcube_plugin_api.php
+++ b/program/include/rcube_plugin_api.php
@@ -74,7 +74,9 @@
     'delete_identity'   => 'identity_delete',
     'save_identity'     => 'identity_update',
     'identity_save'     => 'identity_update',
+    // to be removed after 0.8
     'imap_init'         => 'storage_init',
+    'mailboxes_list'    => 'storage_folders', 
   );
 
   /**
@@ -228,6 +230,20 @@
         'message' => "Invalid callback function for $hook"), true, false);
   }
 
+  /**
+   * Allow a plugin object to unregister a callback.
+   *
+   * @param string $hook Hook name
+   * @param mixed  $callback String with global function name or array($obj, 'methodname')
+   */
+  public function unregister_hook($hook, $callback)
+  {
+    $callback_id = array_search($callback, $this->handlers[$hook]);
+    if ($callback_id !== false) {
+      unset($this->handlers[$hook][$callback_id]);
+    }
+  }
+
 
   /**
    * Triggers a plugin hook.

--
Gitblit v1.9.1