2

I have tried making a module hosted at :

https://github.com/johanvorster/ejabberd_confirm_delivery

I am using ejabberd ver 14.07.

The changes i did:

1. Removed all the ?INFO_MSG statements
2. binarised all the strings. Every occurence of "abc" has been replaced by <<"abc">> and so on.

What else is required? I have been able to compile the module just fine however it doesn't work.

Inputs? Would be great if anybody on the project branch could update the git project as per the newer versions of ejabberd.

I intend to receive xmpp stanzas from every client connected to saya group whenever they receive a message sent by the server.

Thanks

bit_by_bit
  • 337
  • 2
  • 14

1 Answers1

0

I think this module will generate an undef error for send_packet function inside the mod_confirm_delivery.erl. Check your error log in:

//var/log/ejabberd/ejabberd.log

In this module:

ejabberd_hooks:add(user_send_packet, _Host, ?MODULE, send_packet, 50),

This Hook is calling mod_confirm_delivery:send_packet/4 function but in your module send_packet/4 is not define. Hence You have to update the code to match new signature for user_send_packet hook, that is:

user_send_packet(Packet, C2SState, From, To) -> Packet

Follow the link: https://docs.ejabberd.im/developer/hooks/

Hemant Sharma
  • 514
  • 6
  • 17
  • i get error when i use like this ejabberd_hooks:add(user_send_packet(Packet, C2SState, From, To) -> Packet), – Mani Kandan Aug 18 '16 at 07:40
  • That is wrong way for calling a hook, just replace the function that you are using in the hook. i.e, send_packet(From, To, Packet) to send_packet(Packet, C2SState, From, To). and use send_packet/4 inside export. – Hemant Sharma Aug 22 '16 at 10:32
  • @ManiKandan did you never solved this issue? I'm trying to use the johnavorster code with Ejabberd 16.03 – MattC Oct 25 '16 at 09:26