From: Badlop Date: Thu, 1 Dec 2016 21:09:57 +0000 (+0100) Subject: When unsubscribes, check if room should get closed (#1396) X-Git-Tag: 16.12~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d7e1f6d7b38a69391edb13c0de34a917148af2e3;p=ejabberd When unsubscribes, check if room should get closed (#1396) --- diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index b66748e64..c5c0c0fac 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -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;