25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-02 16:37:52 +01:00

* src/mod_muc/mod_muc_room.erl: Return Forbidden error message

when user sends private message in a room that disallows
it (EJAB-595)

SVN Revision: 1323
This commit is contained in:
Badlop 2008-05-12 20:35:43 +00:00
parent a96cf33df3
commit ca8c659804
2 changed files with 18 additions and 5 deletions

View File

@ -1,7 +1,11 @@
2008-05-12 Badlop <badlop@process-one.net>
* src/mod_muc/mod_muc_room.erl: Return Forbidden error message
when user sends private message in a room that disallows
it (EJAB-595)
* src/web/ejabberd_http.erl (parse_auth): Allow password that
include colon character (EJAB-522)
include colon character (EJAB-622)
2008-04-30 Christophe Romain <christophe.romain@process-one.net>

View File

@ -478,9 +478,9 @@ normal_state({route, From, ToNick,
forget_message ->
{next_state, normal_state, StateData};
continue_delivery ->
case (StateData#state.config)#config.allow_private_messages
andalso is_user_online(From, StateData) of
true ->
case {(StateData#state.config)#config.allow_private_messages,
is_user_online(From, StateData)} of
{true, true} ->
case Type of
"groupchat" ->
ErrText = "It is not allowed to send private "
@ -514,10 +514,19 @@ normal_state({route, From, ToNick,
ToJID, Packet)
end
end;
_ ->
{true, false} ->
ErrText = "Only occupants are allowed to send messages to the conference",
Err = jlib:make_error_reply(
Packet, ?ERRT_NOT_ACCEPTABLE(Lang, ErrText)),
ejabberd_router:route(
jlib:jid_replace_resource(
StateData#state.jid,
ToNick),
From, Err);
{false, _} ->
ErrText = "It is not allowed to send private messages",
Err = jlib:make_error_reply(
Packet, ?ERRT_FORBIDDEN(Lang, ErrText)),
ejabberd_router:route(
jlib:jid_replace_resource(
StateData#state.jid,