views:

96

answers:

1

Hi, I'm writing an ejabberd module. What it does is saving some messages into a queue. It actually works very good, there is only one thing I can't find in any documentation. I need to stop hook processing if I find a message coming from a particular user.

I.e. a message is sent to ejabberd, from user A to user B, my module (hooked to user_send_packet hook) processes this message and, if it finds that user A is the specified user, must not deliver it. From what I understood you can achieve this by stopping hook processing. How do you stop hook processing?

+1  A: 

If what you want is to drop messages from A -> B, you can do it by subscribing to the *fiter_packet* hook, and from that return drop to drop the packets you don't want to allow.

From what I understood you can achieve this by stopping hook processing

no, stopping hook processing will prevent other handlers registered on that hook (if any) to be activated, but nothing else, the packet will continue as usual.

ppolv
tnx man it worked ^^
Francesco