mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Pass MUC room private messages over the muc_filter_message too (#3397)
This commit is contained in:
parent
86fc2f157e
commit
3479f88dab
@ -622,13 +622,20 @@ normal_state({route, ToNick,
|
|||||||
jid:replace_resource(StateData#state.jid,
|
jid:replace_resource(StateData#state.jid,
|
||||||
FromNick),
|
FromNick),
|
||||||
X = #muc_user{},
|
X = #muc_user{},
|
||||||
PrivMsg = xmpp:set_from(
|
Packet2 = xmpp:set_subtag(Packet, X),
|
||||||
xmpp:set_subtag(Packet, X),
|
case ejabberd_hooks:run_fold(muc_filter_message,
|
||||||
FromNickJID),
|
StateData#state.server_host,
|
||||||
lists:foreach(
|
Packet2,
|
||||||
fun(ToJID) ->
|
[StateData, FromNick]) of
|
||||||
ejabberd_router:route(xmpp:set_to(PrivMsg, ToJID))
|
drop ->
|
||||||
end, ToJIDs);
|
ok;
|
||||||
|
Packet3 ->
|
||||||
|
PrivMsg = xmpp:set_from(Packet3, FromNickJID),
|
||||||
|
lists:foreach(
|
||||||
|
fun(ToJID) ->
|
||||||
|
ejabberd_router:route(xmpp:set_to(PrivMsg, ToJID))
|
||||||
|
end, ToJIDs)
|
||||||
|
end;
|
||||||
true ->
|
true ->
|
||||||
ErrText = ?T("You are not allowed to send private messages"),
|
ErrText = ?T("You are not allowed to send private messages"),
|
||||||
Err = xmpp:err_forbidden(ErrText, Lang),
|
Err = xmpp:err_forbidden(ErrText, Lang),
|
||||||
|
Loading…
Reference in New Issue
Block a user