Am 03.11.2015 um 07:43 schrieb Andrey Kaskaad:
> Ok. Here is the code that works
> 
> module:set_global();
> function module.add_host(module)
>   module:hook("message/bare", on_message)
> end
> 
> function on_message(event)
>     -- do some work
>     return
> end
> 
> The question now is why the message never get sent to its destination
> when I return true instead of just return?
> 

Because that is the way it's implemented ;).
The documentation at
<https://prosody.im/doc/developers/events#post-routing> actually notes
"Return true from your handler to prevent delivery of the stanza."

One way to think about it is that returning `true` means "I've
sufficiently dealt with this, stop any further processing".
You can actually drop the `return` from your function, and it will still
return `nil`, hence delivering the message. I.e. delivering the message
is in some sense the default.

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to