Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes according to the review comment.
This branch introduces initial rework of the hooks framework The key changes: * hook handler functions now have fixed number of arguments: - Acc - the same meaning as before - Parameters map - input parameters are now provided in a form of map instead of variable number of handler function arguments - Extra map - every hook handler now can have a static context, in the same way as packet handlers. This map is automatically extended with 'hook_name' and 'hook_tag' ('global' or HostType) parameters on hook registration, so there is no need to add HostType into Parameters map any more. * the old format of hook handlers is still supported (until the full conversion of all the hook handlers is done) * conversion of the hooks can be done hook by hook, the following steps must be done to convert the hook: - convert hook execution function at 'mongoose_hooks' module. - convert all the handlers of the hook (they must be registered using gen_hook interface instead of ejabberd_hook). - also, it's possible to mix old & new hook handlers formats (see example at mongoose_hooks:push_notifications/4). * note that 'gen_hook' accepts only external function references (in format "fun Module:Function/Arity', e.g. "fun erlang:is_function/1") as hook handler function parameter.
- Loading branch information