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
1 changed files with 5 additions and 1 deletions

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;