aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2020-08-06 11:44:44 +0200
committerPaweł Chmielowski <pchmielowski@process-one.net>2020-08-06 11:44:44 +0200
commit8a645a2d3d1d5f6d2b1c9cbf202a18c4967f2264 (patch)
tree1507cca44b58b294cfeeb9a268603d87b9c154fe /src
parentImprove explanations of cafile options (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/mod_muc.erl19
1 files 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);