Don't call directly mod_mam in mod_rest, instead run a hook

This commit is contained in:
Badlop 2018-09-05 12:06:14 +02:00
parent b130567e16
commit 2627182cdb
1 changed files with 3 additions and 1 deletions

View File

@ -144,7 +144,9 @@ ip_matches(ClientIp, AllowedValues) ->
AllowedValues).
post_request(Pkt) ->
mod_mam:user_send_packet({Pkt, #{jid => xmpp:get_from(Pkt)}}),
From = xmpp:get_from(Pkt),
LServer = From#jid.lserver,
ejabberd_hooks:run_fold(user_send_packet, LServer, {Pkt, #{jid => From}}, []),
case ejabberd_router:route(Pkt) of
ok -> {200, [], <<"Ok">>};
_ -> {500, [], <<"Error">>}