From efdbf4a7d9283129f46fc6d1a667588e6bda9805 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 30 Apr 2014 08:27:49 -0400
Subject: [PATCH] Support 'error' and 'body_file' return attribs in 'message_before_send' hook (#1489595)

---
 program/lib/Roundcube/rcube.php |    7 +++++++
 CHANGELOG                       |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index bee0c30..96356cd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,6 +14,7 @@
 - Set In-Reply-To and References for forwarded messages (#1489593)
 - Removed redundant default_folders config option (#1489737)
 - Implemented IMAP SPECIAL-USE extension support [RFC6154] (#1487830)
+- Support 'error' and 'body_file' return attribs in 'message_before_send' hook (#1489595)
 - Apply user-specific replacements to group's base_dn property (#1489779)
 - Fix mbox files import
 - Fix bug where "With attachment" option in search filter wasn't selected after return from mail view (#1489774)
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index 7079299..f2aeda7 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -1479,6 +1479,13 @@
         ));
 
         if ($plugin['abort']) {
+            if (!empty($plugin['error'])) {
+                $error = $plugin['error'];
+            }
+            if (!empty($plugin['body_file'])) {
+                $body_file = $plugin['body_file'];
+            }
+
             return isset($plugin['result']) ? $plugin['result'] : false;
         }
 

--
Gitblit v1.9.1