25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Pass MUC room private messages over the muc_filter_message too (#3397)

This commit is contained in:
Badlop 2023-08-04 16:07:14 +02:00
parent 86fc2f157e
commit 3479f88dab

View File

@ -622,13 +622,20 @@ normal_state({route, ToNick,
jid:replace_resource(StateData#state.jid,
FromNick),
X = #muc_user{},
PrivMsg = xmpp:set_from(
xmpp:set_subtag(Packet, X),
FromNickJID),
lists:foreach(
fun(ToJID) ->
ejabberd_router:route(xmpp:set_to(PrivMsg, ToJID))
end, ToJIDs);
Packet2 = xmpp:set_subtag(Packet, X),
case ejabberd_hooks:run_fold(muc_filter_message,
StateData#state.server_host,
Packet2,
[StateData, FromNick]) of
drop ->
ok;
Packet3 ->
PrivMsg = xmpp:set_from(Packet3, FromNickJID),
lists:foreach(
fun(ToJID) ->
ejabberd_router:route(xmpp:set_to(PrivMsg, ToJID))
end, ToJIDs)
end;
true ->
ErrText = ?T("You are not allowed to send private messages"),
Err = xmpp:err_forbidden(ErrText, Lang),