mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-12 21:52:07 +02:00
Temporary room not destroyed when the last participant is expulsed (EJAB-520)
This commit is contained in:
parent
70f00a1b1f
commit
872cc12dd8
|
@ -245,7 +245,7 @@ normal_state({route, From, <<"">>,
|
||||||
NewState = expulse_participant(Packet, From, StateData,
|
NewState = expulse_participant(Packet, From, StateData,
|
||||||
translate:translate(Lang,
|
translate:translate(Lang,
|
||||||
ErrorText)),
|
ErrorText)),
|
||||||
{next_state, normal_state, NewState};
|
close_room_if_temporary_and_empty(NewState);
|
||||||
_ -> {next_state, normal_state, StateData}
|
_ -> {next_state, normal_state, StateData}
|
||||||
end;
|
end;
|
||||||
<<"chat">> ->
|
<<"chat">> ->
|
||||||
|
@ -1126,14 +1126,17 @@ process_presence(From, Nick,
|
||||||
end;
|
end;
|
||||||
_ -> StateData
|
_ -> StateData
|
||||||
end,
|
end,
|
||||||
|
close_room_if_temporary_and_empty(StateData1).
|
||||||
|
|
||||||
|
close_room_if_temporary_and_empty(StateData1) ->
|
||||||
case not (StateData1#state.config)#config.persistent
|
case not (StateData1#state.config)#config.persistent
|
||||||
andalso (?DICT):to_list(StateData1#state.users) == []
|
andalso (?DICT):to_list(StateData1#state.users) == []
|
||||||
of
|
of
|
||||||
true ->
|
true ->
|
||||||
?INFO_MSG("Destroyed MUC room ~s because it's temporary "
|
?INFO_MSG("Destroyed MUC room ~s because it's temporary "
|
||||||
"and empty",
|
"and empty",
|
||||||
[jlib:jid_to_string(StateData#state.jid)]),
|
[jlib:jid_to_string(StateData1#state.jid)]),
|
||||||
add_to_log(room_existence, destroyed, StateData),
|
add_to_log(room_existence, destroyed, StateData1),
|
||||||
{stop, normal, StateData1};
|
{stop, normal, StateData1};
|
||||||
_ -> {next_state, normal_state, StateData1}
|
_ -> {next_state, normal_state, StateData1}
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user