Roundcube Community Forum

 

new Hooks

Started by unicorn, January 13, 2011, 06:16:31 AM

Previous topic - Next topic

unicorn

Hello,

could you add new hooks to SVN ... message_moved & message_deleted?

Something like this...
$args = array(
'uids' => $uids,
'mbox' => $mbox,
'target' => $target,
'new_uids' => $new_uids // is this possible?
);
...
$RCMAIL->plugins->exec_hook('message_moved', $args);
...
$RCMAIL->plugins->exec_hook('message_moved', $args)

We need it for our plugins to further simply upgrade of RC without our patches.

Thanks a lot.

SKaero

You could do that using the javascript hooks before* and after*

unicorn

thank you skaero for your replay.

I don't exactly understand how after* and before* works, can you explain me on the example how it works?

SKaero

Here is an example using the after* hook. In this case after a user deletes a message it should open an alert that says "Message deleted!".
if (window.rcmail) {
rcmail.addEventListener("afterdelete", function(evt) {
alert("Message deleted!");
});
}