Skip to content

Commit

Permalink
Plugin API: Added get_compose_responses hook (#5457)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Oct 29, 2016
1 parent 1618387 commit e3b61cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
12 changes: 10 additions & 2 deletions program/include/rcmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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'];
}

/**
Expand Down

0 comments on commit e3b61cd

Please sign in to comment.