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
0 answers

Ejabberd MQTT Support, Messages Load Balancing and Delivery Guarantees

According to the documentation of ejabberd, it supports both MQTT 3.1.1 and 5 without providing a client library or any more details about what is exactly supported in MQTT. I have a couple of questions about the MQTT support. Does ejabberd support…
0
votes
1 answer

How to add large number of users to muc room in ejabberd?

We have a requirement to add 100k users to a single muc room in ejabberd server. We are using subscribe_room api to add users one by one. While adding users to the muc room, memory consumed by ejabberd is getting increased. At some point, the…
0
votes
1 answer

Which hook to limit the number of messages a user can send per day?

We want to use ejabberd in the context of a web application having fairly unique and business rules, we'd therefore need to have every chat message (not protocol message, but message a user sends to another one) go through our web application…
Samuel
  • 37
  • 5
0
votes
1 answer

discord.py overwrite in create_text_channel permissions

overwrites = { guild.default_role: discord.PermissionOverwrite(read_messages=False), guild.me: discord.PermissionOverwrite(read_messages=True) } channel = await guild.create_text_channel('secret', overwrites=overwrites i want to add…
Noel G
  • 116
  • 6
0
votes
1 answer

Problem using jid:make/2 in ejabberd-18.09

I am using ejabberd-18.09. I have this code MucCreateReply = mod_muc:create_room(HostName,Roomname,jid:decode(Name),NickName,default), RoomJid = jid:make(Roomname, HostName), where HostName = <<"conference.abc.com">>, Roomname =…
abhishek ranjan
  • 612
  • 7
  • 23
0
votes
2 answers

How can the recipient be informed that someone has blocked them on ejabberd?

We are building a chat app using latest ejabberd and there is a use case where user A blocks user B. the requirement is to hide last seen or user's presence from each other. if A blocks B then its easy to hide these information from user A but how…
Tareq Assi
  • 149
  • 13
0
votes
1 answer

ejabberd-18.12 : parse Packet inside hook

Hook code : user_receive_packet({Packet, #{jid := JID} = C2SState}) -> ?INFO_MSG("~p.", [Packet]), {Packet,…
0
votes
1 answer

correct syntax for the hook user_receive_packet in ejabberd-18.12?

Current code : user_receive_packet({Packet, C2SState}) -> ?INFO_MSG("~p.", [Packet]), {Packet, C2SState}. Getting error when the hook is invoked: [error] Hook user_receive_packet crashed when running... ** Reason =…
Md. Arafat Al Mahmud
  • 3,124
  • 5
  • 35
  • 66
0
votes
2 answers

retrieve timestamp value inside muc_filter_message hook

Is it possible to get the timestamp of the message inside muc_filter_message hook ? I need to notify the muc messages, the notification payload must include the timestamp of the messages. muc_filter_message(#message{from = From, body = Body} =…
0
votes
1 answer

Unable to understand a crash while adding a field in vcard in ejabberd

I am trying to add a new field in the vcard as “Abc” . For this I added an xml for this “Abc” field in xmpp_codec.spec file. And referenced it in the #vcard_temp. I placed the xmpp_codec.erl,xmpp_codec.hrl, xep0054.erl files thus generated after…
0
votes
0 answers

Module to handle custom iq stanzas does not work with ejabberd-18.09

I am trying to move to ejabberd-18.09 from ejabberd-17.03. I have this module so that I can send custom iq stanzas to ejabberd. -module(mod_test_custom). %% ==================================================================== %% API functions %%…
0
votes
1 answer

Parsing ejabberd packet with erlang

I am using ejabberd18.09 for IM application. the application has few features that needed to add extensions to the ejabberd(xmpp) messages. I created a custom module on the offline_message_hook to capture the offline messages and send them to my own…
Tareq Assi
  • 149
  • 13
0
votes
2 answers

Timer:apply_interval/4 stops when user goes oflline and comes Back again in ejabberd

I am using ejabberd-17.03 from source code on linux machine. I created a temporary chatroom programatically from the the server using userA’s jid and send direct invitation to user B which he accepts and join the chatroom. My use case is that two…
abhishek ranjan
  • 612
  • 7
  • 23
0
votes
1 answer

Ejabberd hook for banned account

Our hook on muc_filter_presence does not receive calls when user is banned and forced to leave chat room. Is this expected? If so, is there other hook we could use for "user ban" callbacks? We are using ejabberd 18.04.
Stefan
  • 1
0
votes
1 answer

Is there any way to delete single message from ejabberd archive

I am using ejabberd for my chat app, I want to add delete single message feature. Is there any way in ejabberd 18.03