[RCD] Plugin API register task

Thomas Bruederli thomas at roundcube.net
Thu Aug 14 18:28:39 CEST 2014


On Thu, Aug 14, 2014 at 3:52 PM, Rosali <myroundcube at mail4us.net> wrote:
> Hello Devs,
>
> I don't understand how I should handle $this->register_task.
>
> I have noticed if a plugin is running on its own task then it behaves
> strange.
>
> I think it is best to give an example:
>
> [...]
>
> So, what am I doing wrong? How do I have to register the action in a plugin
> so that they are properly recognized while staying on a task which is
> registered/owned by another plugin?

I guess looking at the request dispatching routine [1] clarifies the
situation. First it checks is_plugin_task() and only if it isn't, the
'plugin.' prefix is checked. We might change the order of these checks
and give precedence to 'plugin.*' actions but I can't imagine the
side-effects such a change might have.

A work-around for your particular situation could be to execute
rcmail.http_post('mail/plugin.carddav-addressbook-sync') or
rcmail.http_post('foo/plugin.carddav-addressbook-sync') in order to
not hit a task that is registered by a plugin.

Kind regards,
Thomas

[1] https://github.com/roundcube/roundcubemail/blob/master/index.php#L296


More information about the dev mailing list