Questions tagged [ejabberd-hooks]

ejabberd provides an event mechanism. Each module can subscribe to events and a hook in the module code is called when the event occurs.

ejabberd provides an event mechanism. Each module can subscribe to events and a hook in the module code is called when the event occurs.

When ejabberd is processing an arbitrary event (incoming IQ, outgoing presence, configuration change, etc), it is convenient to consider some of them notable. In order for someone to be notified of such events, ejabberd executes "hooks". A hook is represented by a unique name. All functions associated with the hook's name will be called in some specified order.

Site: https://www.ejabberd.im/Events%20and%20hooks

Docs: https://docs.ejabberd.im/developer/guide/#hooks

55 questions
0
votes
2 answers

Ejabberd 17: How to create a hook which is called for offline messages?

I want to create a hook which is called whenever an offline message is created. Example: user-a(online) send a message to user-b(offline). Then as per ejabberd the message is stored and sent when user-b comes online. But in this situation, I want to…
0
votes
1 answer

ejabberd: mom_mam throws error

I've just installed ejabberd from the sources (18.04) with MySQL support and changed the configuration file respectively. Basically everything works: ejabberd starts, I can register users, users can connect and send messages. I also see all users in…
Christian
  • 3,239
  • 5
  • 38
  • 79
0
votes
1 answer

When does the user_receive_packet hook gets started/triggered

I am using hooks in ejabberd to create a custom module and have used user_send_packet hook till now.I wanted to implement a custom functionality on ejabberd server as soon as (and after) the packet is sent to the client from the server. I am…
abhishek ranjan
  • 612
  • 7
  • 23
0
votes
1 answer

How do I append custom data in the body of a xmpp message in ejabberd

I have set up a chat settong using Pidgin and Ejabberd.I have written down a custom module in ejabberd using user_send_packet: ejabberd_hooks:add(user_send_packet, _Host, ?MODULE, myMessage, 95), The function myMessage is as…
abhishek ranjan
  • 612
  • 7
  • 23
0
votes
1 answer

Message lost when recipient disconnect suddenly in Ejabberd

Message lost when recipient disconnect from INTERNET suddenly due to some network problem. In this case I want to stop message lose. Example: User A and B are online and chatting. A send messages to B. Then suddenly User B lost INTERNET connection,…
0
votes
1 answer

Ejabberd - Route message to users in offline_message_hook

I want to build a customer support chat app. There are users and an admin. Below admin there are multiple sub-admins. Initially the chat is initiated with admin only, but if the admin is offline I need to route the message to…
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267
0
votes
1 answer

Ejabberd - undef module not found when using hook

I'm learning to use Hooks to build an Ejabberd module. This is the tutorial I'm referring. Following is my code:- -module(mod_sunshine). -behavior(gen_mod). -include("ejabberd.hrl"). -include("logger.hrl"). -export([start/2, stop/1,…
Praful Bagai
  • 16,684
  • 50
  • 136
  • 267
0
votes
1 answer

How does handshaking takes pace in ejabberd server

I have just started using ejabberd as a messaging server. Now I have read that TCP connections follow the handshaking method for setting up the connection, and I was wondering that how ejabberd follows the handshaking method whenever any client…
0
votes
1 answer

How to Use ejabberd register module for custom login

I am new to ejabberd and erlang and have created a basic application that first checks that whether the user has login or not. So basically it checks the mnesia table of login and confirms this. Now I saw that ejabberd also has a registration…
0
votes
2 answers

The expected Ejabberd filter_packet function not being called

The ejabberd module I'm using, mod_pottymouth is not filtering messages as expected. After adding logging I see a generic handler method being called instead of the one that does the actual filtering. Problem is, I am not able to parse the ejabberd…
bwsmith
  • 165
  • 2
  • 4
  • 11
0
votes
1 answer

jabbered 17.01 offline message hook gives error

I am trying to write module for ejabberd 17.01. It has been working on ejabberd 16.08. I installed ejabberd with package installer. -module(mod_imran_offline). -author('igggg'). -behaviour(gen_mod). %% Required by ?INFO_MSG…
For Guru
  • 1,197
  • 13
  • 23
0
votes
0 answers

Message lost when client connection lost suddenly in ejabberd

I'm new to ejabberd. my problem is that when the wifi connection is lost suddenly, the messages are lost for few seconds. according to the Link I have enabled Stream Management and resend_on_timeout set to true and enabled mod_ping with…
Salini L
  • 829
  • 5
  • 15
  • 43
0
votes
2 answers

How to save extra fields in archive table using Ejabberd mod_mam (Message Archive Management, XEP-0313)?

I am using Ejabberd server for chatting application. It works to save messages in arhieve table, but I want to save additional field in the table when message is sent. This field will be per message.
user1820017
  • 61
  • 1
  • 2
  • 10
0
votes
0 answers

Ejabberd error while communicating Wait for feature request error

2016-09-05 19:34:51.079 [info] <0.498.0>@ejabberd_http:init:157 started: {gen_tcp,#Port<0.3947>} 2016-09-05 19:35:06.894 [info] <0.491.0>@ejabberd_listener299 (#Port<0.3948>) Accepted connection 103.255.4.61:40738 -> 162.243.172.244:5222 2016-09-05…
0
votes
2 answers

Ejabberd difference between offline and unavailable

We are implementing a chat infrastructure with using ejabberd-16.08 and we've decided to use mod_interact(https://github.com/adamvduke/mod_interact) for sending request to our webservers while the receipant user is offline (so we can send them push…