Don't return error for blocked MUC PMs

If a message stanza is blocked as per XEP-0016 or XEP-0191 and the
stanza is marked as a private MUC message, don't return an error.  This
makes sure users won't be kicked from MUC rooms when blocking other
participants.
This commit is contained in:
Holger Weiss 2016-07-24 20:55:11 +02:00
parent d4d1941133
commit 4b0d71d402
1 changed files with 12 additions and 5 deletions

View File

@ -1632,11 +1632,18 @@ handle_info({route, From, To,
<<"groupchat">> -> ok;
<<"headline">> -> ok;
_ ->
Err =
jlib:make_error_reply(Packet,
?ERR_SERVICE_UNAVAILABLE),
ejabberd_router:route(To, From,
Err)
case fxml:get_subtag_with_xmlns(Packet,
<<"x">>,
?NS_MUC_USER)
of
false ->
Err =
jlib:make_error_reply(Packet,
?ERR_SERVICE_UNAVAILABLE),
ejabberd_router:route(To, From,
Err);
_ -> ok
end
end,
{false, Attrs, StateData}
end;