Roundcube Community Forum

Release Support => Requests => Topic started by: unicorn on January 13, 2011, 06:16:31 AM

Title: new Hooks
Post by: unicorn on January 13, 2011, 06:16:31 AM
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.
Title: new Hooks
Post by: SKaero on January 13, 2011, 02:21:29 PM
You could do that using the javascript hooks before* and after*
Title: new Hooks
Post by: unicorn on January 14, 2011, 01:50:31 PM
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?
Title: new Hooks
Post by: SKaero on January 15, 2011, 05:24:51 AM
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!");
});
}