mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-25 14:24:55 +02:00
* src/mod_muc/mod_muc_room.erl: Merge SVN r1164, and fix the merge
of SVN r1179 (EJAB-496) SVN Revision: 1196
This commit is contained in:
parent
9a795401ae
commit
c72082d798
@ -1,3 +1,8 @@
|
|||||||
|
2008-02-16 Badlop <badlop@process-one.net>
|
||||||
|
|
||||||
|
* src/mod_muc/mod_muc_room.erl: Merge SVN r1164, and fix the merge
|
||||||
|
of SVN r1179 (EJAB-496)
|
||||||
|
|
||||||
2008-02-15 Badlop <badlop@process-one.net>
|
2008-02-15 Badlop <badlop@process-one.net>
|
||||||
|
|
||||||
* doc/release_notes_2.0.0.txt: Describe in the Release Notes the
|
* doc/release_notes_2.0.0.txt: Describe in the Release Notes the
|
||||||
|
@ -467,18 +467,12 @@ normal_state({route, From, ToNick,
|
|||||||
Lang = xml:get_attr_s("xml:lang", Attrs),
|
Lang = xml:get_attr_s("xml:lang", Attrs),
|
||||||
case decide_fate_message(Type, Packet, From, StateData) of
|
case decide_fate_message(Type, Packet, From, StateData) of
|
||||||
{expulse_sender, Reason} ->
|
{expulse_sender, Reason} ->
|
||||||
?INFO_MSG(Reason, []),
|
?DEBUG(Reason, []),
|
||||||
Status_text = "This participant sent a bad error message to another participant.",
|
ErrorText = "This participant is kicked from the room because "
|
||||||
NewState =
|
"he sent an error message to another participant",
|
||||||
add_user_presence_un(
|
NewState = expulse_participant(Packet, From, StateData,
|
||||||
From,
|
translate:translate(Lang, ErrorText)),
|
||||||
{xmlelement, "presence",
|
{next_state, normal_state, NewState};
|
||||||
[{"type", "unavailable"}],
|
|
||||||
[{xmlelement, "status", [], [{xmlcdata, Status_text}]}]},
|
|
||||||
StateData),
|
|
||||||
send_new_presence(From, NewState),
|
|
||||||
{next_state, normal_state,
|
|
||||||
remove_online_user(From, NewState)};
|
|
||||||
forget_message ->
|
forget_message ->
|
||||||
{next_state, normal_state, StateData};
|
{next_state, normal_state, StateData};
|
||||||
continue_delivery ->
|
continue_delivery ->
|
||||||
@ -1001,26 +995,28 @@ list_to_affiliation(Affiliation) ->
|
|||||||
%% Decide the fate of the message and its sender
|
%% Decide the fate of the message and its sender
|
||||||
%% Returns: continue_delivery | forget_message | {expulse_sender, Reason}
|
%% Returns: continue_delivery | forget_message | {expulse_sender, Reason}
|
||||||
decide_fate_message("error", Packet, From, StateData) ->
|
decide_fate_message("error", Packet, From, StateData) ->
|
||||||
case catch check_error_kick(Packet) of
|
%% Make a preliminary decision
|
||||||
|
PD = case check_error_kick(Packet) of
|
||||||
%% If this is an error stanza and its condition matches a criteria
|
%% If this is an error stanza and its condition matches a criteria
|
||||||
true ->
|
|
||||||
%% If the sender of the message is online
|
|
||||||
case is_user_online(From, StateData) of
|
|
||||||
true ->
|
true ->
|
||||||
Reason = io_lib:format("This participant is considered a ghost and is expulsed: ~s",
|
Reason = io_lib:format("This participant is considered a ghost and is expulsed: ~s",
|
||||||
[jlib:jid_to_string(From)]),
|
[jlib:jid_to_string(From)]),
|
||||||
{expulse_sender, Reason};
|
{expulse_sender, Reason};
|
||||||
|
false ->
|
||||||
|
continue_delivery
|
||||||
|
end,
|
||||||
|
case PD of
|
||||||
|
{expulse_sender, R} ->
|
||||||
|
case is_user_online(From, StateData) of
|
||||||
|
true ->
|
||||||
|
{expulse_sender, R};
|
||||||
false ->
|
false ->
|
||||||
forget_message
|
forget_message
|
||||||
end;
|
end;
|
||||||
false ->
|
Other ->
|
||||||
continue_delivery;
|
Other
|
||||||
{'EXIT', Error} ->
|
|
||||||
Reason = io_lib:format(
|
|
||||||
"This participant sent a problematic packet and is expulsed: ~s~nPacket: ~p~nError: ~p",
|
|
||||||
[jlib:jid_to_string(From), Packet, Error]),
|
|
||||||
{expulse_sender, Reason}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
decide_fate_message(_, _, _, _) ->
|
decide_fate_message(_, _, _, _) ->
|
||||||
continue_delivery.
|
continue_delivery.
|
||||||
|
|
||||||
@ -1045,7 +1041,7 @@ get_error_condition(Packet) ->
|
|||||||
case catch get_error_condition2(Packet) of
|
case catch get_error_condition2(Packet) of
|
||||||
{condition, ErrorCondition} ->
|
{condition, ErrorCondition} ->
|
||||||
ErrorCondition;
|
ErrorCondition;
|
||||||
{'EXIT', Error} ->
|
{'EXIT', _} ->
|
||||||
"badformed error stanza"
|
"badformed error stanza"
|
||||||
end.
|
end.
|
||||||
get_error_condition2(Packet) ->
|
get_error_condition2(Packet) ->
|
||||||
@ -3107,6 +3103,7 @@ check_invitation(From, Els, Lang, StateData) ->
|
|||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
% Logging
|
% Logging
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user