From e3b61cd487fffb802179702a4a9ac553273b0c1e Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 29 Oct 2016 10:59:39 +0200 Subject: [PATCH] Plugin API: Added get_compose_responses hook (#5457) --- CHANGELOG | 1 + program/include/rcmail.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2c5113a2a11..5e8939ad0fe 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Plugin API: Added get_compose_responses hook (#5457) - Display error when trying to upload more files than specified in max_file_uploads (#5483) - Add missing sql upgrade file for 'ip' column resize in session table (#5465) - Do not show inline images of unsupported mimetype (#5463) diff --git a/program/include/rcmail.php b/program/include/rcmail.php index a6d07695f51..415717cc1b6 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -380,7 +380,7 @@ public function get_compose_responses($sorted = false, $user_only = false) if (!$user_only) { foreach ($this->config->get('compose_responses_static', array()) as $response) { if (empty($response['key'])) { - $response['key'] = substr(md5($response['name']), 0, 16); + $response['key'] = substr(md5($response['name']), 0, 16); } $response['static'] = true; @@ -405,7 +405,15 @@ public function get_compose_responses($sorted = false, $user_only = false) ksort($responses, SORT_LOCALE_STRING); } - return array_values($responses); + $responses = array_values($responses); + + $hook = $this->plugins->exec_hook('get_compose_responses', array( + 'list' => $responses, + 'sorted' => $sorted, + 'user_only' => $user_only, + )); + + return $hook['list']; } /**