25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +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 98e47e8c73
commit da56452fba
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-05-09 Mickael Remond <mremond@process-one.net>

View File

@ -475,9 +475,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 "
@ -511,10 +511,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,