aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2014-05-05 13:50:52 +0200
committerBadlop <badlop@process-one.net>2014-05-05 13:50:52 +0200
commit872cc12dd8b318f761667b3e878d54db79bbb46f (patch)
tree00d348ac6cfc5c1932d755356d48409a87d532a5
parentextauth_cache can have value 0 (diff)
Temporary room not destroyed when the last participant is expulsed (EJAB-520)
Diffstat (limited to '')
-rw-r--r--src/mod_muc_room.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl
index 8126012cb..3842fde40 100644
--- a/src/mod_muc_room.erl
+++ b/src/mod_muc_room.erl
@@ -245,7 +245,7 @@ normal_state({route, From, <<"">>,
NewState = expulse_participant(Packet, From, StateData,
translate:translate(Lang,
ErrorText)),
- {next_state, normal_state, NewState};
+ close_room_if_temporary_and_empty(NewState);
_ -> {next_state, normal_state, StateData}
end;
<<"chat">> ->
@@ -1126,14 +1126,17 @@ process_presence(From, Nick,
end;
_ -> StateData
end,
+ close_room_if_temporary_and_empty(StateData1).
+
+close_room_if_temporary_and_empty(StateData1) ->
case not (StateData1#state.config)#config.persistent
andalso (?DICT):to_list(StateData1#state.users) == []
of
true ->
?INFO_MSG("Destroyed MUC room ~s because it's temporary "
"and empty",
- [jlib:jid_to_string(StateData#state.jid)]),
- add_to_log(room_existence, destroyed, StateData),
+ [jlib:jid_to_string(StateData1#state.jid)]),
+ add_to_log(room_existence, destroyed, StateData1),
{stop, normal, StateData1};
_ -> {next_state, normal_state, StateData1}
end.