protocol: Fix logic on JOIN, hook properly
doc/hooks: Add example hooks module