From 8a645a2d3d1d5f6d2b1c9cbf202a18c4967f2264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Thu, 6 Aug 2020 11:44:44 +0200 Subject: [PATCH] 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. --- src/mod_muc.erl | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/mod_muc.erl b/src/mod_muc.erl index 59ea3190a..718f29b3e 100644 --- a/src/mod_muc.erl +++ b/src/mod_muc.erl @@ -790,18 +790,13 @@ load_permanent_rooms(Hosts, ServerHost, Opts) -> lists:foreach( fun(R) -> {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 - error -> - start_room(RMod, Host, ServerHost, Access, - Room, HistorySize, RoomShaper, - R#muc_room.opts, QueueType); - {ok, _} -> - ok - end; - _ -> - forget_room(ServerHost, Host, Room) + case RMod:find_online_room(ServerHost, Room, Host) of + error -> + start_room(RMod, Host, ServerHost, Access, + Room, HistorySize, RoomShaper, + R#muc_room.opts, QueueType); + {ok, _} -> + ok end end, get_rooms(ServerHost, Host)) end, Hosts);