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 message to ensure the proper function is called. Can anyone help?
on_filter_packet({_From, _To, {xmlel, <<"message">>, _Attrs, Els} = _Packet} = _Msg) ->
%This is what should be called to filter messages, but is never called
FilteredEls = filterMessageBodyElements(Els, []),
{_From, _To, {xmlel, <<"message">>, _Attrs, FilteredEls}};
on_filter_packet(Msg) ->
% This is what actually gets called
Msg.
This is using ejabberd 17.01