Fix code to support sending iq and presence, not only message
This commit is contained in:
parent
fc40a38780
commit
9fe5f383dc
|
@ -120,7 +120,7 @@ get_option_access(Host) ->
|
||||||
|
|
||||||
%% This function crashes if the stanza does not satisfy configured restrictions
|
%% This function crashes if the stanza does not satisfy configured restrictions
|
||||||
check_stanza(Pkt, Host) ->
|
check_stanza(Pkt, Host) ->
|
||||||
To = Pkt#message.to,
|
To = xmpp:get_to(Pkt),
|
||||||
check_member_option(Host, jlib:jid_to_string(To), allowed_destinations),
|
check_member_option(Host, jlib:jid_to_string(To), allowed_destinations),
|
||||||
%%+++ {xmlel, StanzaType, _Attrs, _Kids} = Stanza,
|
%%+++ {xmlel, StanzaType, _Attrs, _Kids} = Stanza,
|
||||||
%%+++ check_member_option(Host, StanzaType, allowed_stanza_types),
|
%%+++ check_member_option(Host, StanzaType, allowed_stanza_types),
|
||||||
|
@ -145,7 +145,7 @@ ip_matches(ClientIp, AllowedValues) ->
|
||||||
AllowedValues).
|
AllowedValues).
|
||||||
|
|
||||||
post_request(Pkt) ->
|
post_request(Pkt) ->
|
||||||
mod_mam:user_send_packet({Pkt, #{jid => Pkt#message.from}}),
|
mod_mam:user_send_packet({Pkt, #{jid => xmpp:get_from(Pkt)}}),
|
||||||
case ejabberd_router:route(Pkt) of
|
case ejabberd_router:route(Pkt) of
|
||||||
ok -> {200, [], <<"Ok">>};
|
ok -> {200, [], <<"Ok">>};
|
||||||
_ -> {500, [], <<"Error">>}
|
_ -> {500, [], <<"Error">>}
|
||||||
|
|
Loading…
Reference in New Issue