Hook to block messages between users

Hi,
While I could use mod_privacy, my implementation of blocking is much simpler since my XMPP service is private and most features are custom.

I am looking for a way of using hooks to disable the transmission of messages between 2 users. I looked into mod_privacy, but there is not much documentation in the module's files to tell me where exactly it blocks messages, iq, presence.

Please let me know of a simple way I could terminate the transmission of a message using a hook.

Thanks,

You can look as example code:

You can look as example code: http://www.ejabberd.im/mod_filter

Hook

I am looking to be able to read from a DB a list of blocks, and don't necessarily want to use mod_privacy (too bloated for my implementation).

I wrote a hook handler for privacy_check_packet, which returns the atom deny but the packet is still allowed to be sent...

Am I missing something?

Thank you again for your help,
very much appreciated.

Hook

I got IQ to be blocked, I saw that ejabberd_c2s will only block request IQs, and I see that for message stanzas, privacy_check_packet just returns a tuple {false, _, _} and the message seems to go through even if my handle for the privacy_check_packet returns deny...

THanks,

I see how you did it in the code and it now works.

Thanks!

Syndicate content