Search code examples
ejabberd

ejabberd add hook sequence


The ejabberd_hooks add function takes Seq as the final parameter. What is its function?

https://www.process-one.net/docs/ejabberd/devdoc/trunk/ejabberd_hooks.html#add-5

add(Hook, Host, Module, Function, Seq) -> any()

Solution

  • ejabberd_hooks:add(Hook, Host, Module, Function, Priority)
    

    Priority is the hook rank, to determine in which order the hooks are run (when several hooks are defined for the same event). You can use it if you have dependencies between hooks.

    Check the official documents here.