25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Don't forget not-persistent rooms in load_permanent_rooms

Only non-persistent rooms that we are storing are those that were hibernated
but also have mucsub subscribers in them. I don't think it makes sense to
destroy those rooms on restart/reload if we didn't destroy them in first
place when last member did leave room, let just handle those rooms like
they are persistent, and kill them only when all user unsubscribe from them
or they are destroyed from api.
This commit is contained in:
Paweł Chmielowski 2020-08-06 11:44:44 +02:00
parent 4a54395561
commit 8a645a2d3d

View File

@ -790,8 +790,6 @@ load_permanent_rooms(Hosts, ServerHost, Opts) ->
lists:foreach( lists:foreach(
fun(R) -> fun(R) ->
{Room, _} = R#muc_room.name_host, {Room, _} = R#muc_room.name_host,
case proplists:get_bool(persistent, R#muc_room.opts) of
true ->
case RMod:find_online_room(ServerHost, Room, Host) of case RMod:find_online_room(ServerHost, Room, Host) of
error -> error ->
start_room(RMod, Host, ServerHost, Access, start_room(RMod, Host, ServerHost, Access,
@ -799,9 +797,6 @@ load_permanent_rooms(Hosts, ServerHost, Opts) ->
R#muc_room.opts, QueueType); R#muc_room.opts, QueueType);
{ok, _} -> {ok, _} ->
ok ok
end;
_ ->
forget_room(ServerHost, Host, Room)
end end
end, get_rooms(ServerHost, Host)) end, get_rooms(ServerHost, Host))
end, Hosts); end, Hosts);