Hi all,
I have spend the day writing a little plugin to change 'special folders' per identity.
I have written most of the plugin now, but I can not seem to get my message_compose hook to fire.
I am running rc 0.6 and here is the snippet of code that is keeping me up all night.
class identity_folders extends rcube_plugin
{
public $task = 'settings|mail';
private $rcmail;
function init() {
$this->rcmail = rcmail::get_instance();
$this->load_config();
//...
$this->add_hook('message_compose', array($this, 'message_compose'));
}
//...
function message_compose ($args) {
$params = array(
'param' => array(),
'attachments' => array()
);
$params['param']['body'] = 'blah';
return $params;
}
}
I am successfully running functions under other hooks only message_compose is giving me problems.
The function is never executed
Looking at this file
// program/steps/mail/compose.inc
//...
if (!is_array($_SESSION['compose']))
//...
$plugin = $RCMAIL->plugins->exec_hook('message_compose', $_SESSION['compose']);
//...
}
//...
I can not seem to compose a mail in such a manor that $_SESSION['compose'] is not an array.
Can anyone confirm this as a bug or show me the correct way to do this?
I believe that is a bug it should work with RoundCube 0.7.
Thanks. I was relying on my distros package system to inform me of updates.
just did a quick test with 0.7 and it seems to work there - will finish my plugin and release it into the wild for testing soon :)