25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

When unsubscribes, check if room should get closed (#1396)

This commit is contained in:
Badlop 2016-12-01 22:09:57 +01:00
parent 34f2a8a4f2
commit d7e1f6d7b3

View File

@ -3745,7 +3745,11 @@ process_iq_mucsub(From, #iq{type = set, sub_els = [#muc_unsubscribe{}]},
NewStateData = StateData#state{subscribers = Subscribers,
subscriber_nicks = Nicks},
store_room(NewStateData),
{result, undefined, NewStateData};
NewStateData2 = case close_room_if_temporary_and_empty(NewStateData) of
{stop, normal, _} -> stop;
{next_state, normal_state, SD} -> SD
end,
{result, undefined, NewStateData2};
_ ->
{result, undefined, StateData}
end;