Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

documentation for ejabberd hooks?

Hooks seem to be pretty handy to extend the funcionality of ejabberd.

There are bunch of ejabberd hooks mentioned by the makers,but it difficult to understand which one is to be used when,apart from few.

can anybody share some details from their experiences that explains what a particular hook does?

like image 801
HIRA THAKUR Avatar asked Nov 04 '14 10:11

HIRA THAKUR


People also ask

What is ejabberd used for?

ejabberd is a free and open source instant messaging server written in Erlang/OTP . ejabberd is cross-platform, distributed, fault-tolerant, and based on open standards to achieve real-time communication. ejabberd is designed to be a rock-solid and feature rich XMPP server.


1 Answers

There will be certain events on which you would like to trigger some action.Hooks couples your code with some components of ejabberd when an event occurs.You can write your own custom code(a.ka. Event Handler) and integrate it to ejabberd with HOOK.

  • filter_packet : This hook is run by ejabberd_router as soon as the packet is routed via ejaberd_router:route/3. ejabberd_c2s calls it after it receives a packet from ejabberd_receiver(i.e. the socket) and multiple modules use it for sending replies and errors.
  • offline_message_hook : when ejabberd routes the stanza and receiver is offline.
  • user_receive_packet : The hook is run just after a packet has been sent to the user.
like image 184
HIRA THAKUR Avatar answered Oct 20 '22 19:10

HIRA THAKUR