Closed nomanAli95 closed 1 month ago
the current behavior is defined by the callback module, by default it's mod_event_pusher_http_defaults
, also at the moment that's the only callback module distributed in the open-source codebase.
and this callback module does exactly what is promised in the documentation:
Name of a module which should be used to check whether a notification should be sent. The default callback module, mod_event_pusher_http_defaults, sends notifications for all non-empty chat messages. You can use this module as a starting point for developing a custom one.
as you said, it sends notifications for non-empty chat messages
, it is not supposed to send notifications for groupchat
messages.
I haven't tested it but I think you can achieve the desired behavior with just a small change to the mod_event_pusher_http_defaults. simply replace the current implementation of should_make_req_type/5
with this one:
should_make_req_type(_Acc, <<"chat">>, Body, _From, _To) when Body /= <<"">> ->
true;
should_make_req_type(_Acc, <<"groupchat">>, Body, _From, _To) when Body /= <<"">> ->
true;
should_make_req_type(_Acc, _, _, _, _) ->
false.
Great! Many thanks!
Description:
Currently using mod_event_pusher with HTTP backend is not possible to send http requests for groupchat type messages, but only for chat type messages.
Steps to Reproduce:
Enable mod_event_pusher with HTTP backend as described in: https://esl.github.io/MongooseDocs/6.2.0/modules/mod_event_pusher_http/
Send a message to a user on a groupchat
Expected Behavior:
MongooseIM sends HTTP requests for both type of messages (chat, groupchat) or it allows you to choose the type by any kind of configuration for mod_event_pusher with HTTP backend.
Actual Behavior:
MongooseIM does not send any HTTP requests to the endpoint declared in configuration for groupchat messages