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
4
votes
2 answers

how to tackle a race condition between function calls

I have built a multi player game(to be exact, 4 players) using the Message passing construct of erlang. I have followed the tictactoe game on the following link as a example but what really is similar is the Message passing construct as shown in…
2
votes
1 answer

Custom module in Ejabberd is not called

Original I was trying for days to adapt an open source Ejabberd module (mod_offline_http_post), working for previous versions, to the current version (20.04). For example, some parts are now important to be exported like mod_options and mod_depends.…
Pape
  • 109
  • 7
2
votes
2 answers

Ejabberd Message delivery while application is terminated

I am developing a chat app using ejabberd server for both IOS and Android. I also wrote a module for ejabberd to get the offline messages sent to my own server api . my own server api will send notifications to the IOS/Android platforms using FCM.…
2
votes
2 answers

User send packet hook returning `badmatch` error

I am using user send packet hook in my custom module, I am not understanding why getting badmatch error for each of the packet received. i have added declaration part here too. **Code** -module(mod_post_log). -behaviour(gen_mod). …
Nitin
  • 197
  • 1
  • 1
  • 9
1
vote
0 answers

Ejabberd Server-Consumer Communication Mode

I am a graduate student conducting a comprehensive survey of open-source messaging middleware. I have a couple of questions about the Communication Mode of Server-Consumer traffic in Ejabberd (eCS). For a message that is sent from ejabberd to a…
1
vote
1 answer

Configuration related issue while implementing pyejabberd message system

I am implementing a message system in my python app and to achieve this I am using the client library of ejabberd which is pyejabberd. I have checked the official documentation of this to configure the ejabberd.yml file but getting some errors.…
1
vote
1 answer

Ejabberd 18.04 - Custom Module - Read custom message field from Packet

I am trying to implement a custom module to log all the messages to a webhook. I've found a good reference to do that, https://github.com/PH-F/mod_offline_http_post/blob/master/src/mod_offline_http_post.erl. I have some custom tag in the message…
dichen
  • 1,643
  • 14
  • 19
1
vote
0 answers

Getting Room Name or Subject From Muc Hooks

I want to get the room's name or subject from one of the ejabberd hooks. I've a method like in the below code and I want to get room's name or subject within that method. Is something like that possible? muc_filter_message(Stanza, MUCState, RoomJID,…
tolgatanriverdi
  • 561
  • 9
  • 31
1
vote
0 answers

How to manage the payload contents of push notifications for iPhone in Ejabberd

I have created a chat application in iPhone with Ejabberd 16.03. If end user mobile app is not running in the foreground/background, an alert is sent each time a message is received via push notification by Ejabberd. In the payload of this…
1
vote
1 answer

How to paginate roster fetch call on ejabberd

I am running my chat service on ejabberd, but after 4-5 months of no downtime, I have come to use case where it's taking a lot of time in fetching rosters for the users whose roster list is too big. At many places it's mentioned that pagination…
1
vote
1 answer

when is a session created in ejabberd ? How does authentication work ?

Im trying to understand the data flow of ejabberd and having a hard time till now. First, these are the modules Im working on: ejabberd_c2s, ejabberd_auth, ejabberd_sm, ejabberd_sm_mnesia. I understand that ejabberd_c2s is a gen_fsm that is entry…
sad
  • 820
  • 1
  • 9
  • 16
1
vote
0 answers

Finding the run hooks and run_fold hooks

The documentation https://docs.ejabberd.im/developer/hooks/ says there are two types of hooks run_hook(whose return type is not used) and run_fold(whose return type is used in future hooks) hook. As an example for the run_fold hook the filter_packet…
Talespin_Kit
  • 20,830
  • 29
  • 89
  • 135
1
vote
1 answer

How to resolve undef error in ejabberd hook

I have added a customized module named mod_confirm_delivery in ejabberd which has compiled and added successfully but when i am sending a message an error is coming in my ejabberd error log file, That is: 2016-03-15 17:03:38.306 [error]…
Hemant Sharma
  • 514
  • 6
  • 17
1
vote
2 answers

How to plan messages on ejabberd?

I want to make my ejabberd able to plan messages. Which could be the best solution for this purpose? And supposing that I have all the messages stored on the db, with the recipient (to) and with the date (year, month, day, hour..) when they must be…
joanlopez
  • 579
  • 1
  • 6
  • 17
1
vote
1 answer

ejabberd syncing message from mysql archive

I am working on ejabberd for quite sometime now, I am replacing a third party Chat infra with Ejabberd inhouse. As it was production switch so we need to maintain the previous chat messages while switching to ejabberd. So I have created all the…
1
2 3 4