Rooms_all = get_rooms(ServerHost),
%% Decide which ones pass the requirements
- Rooms_pass = decide_rooms(Rooms_all, Last_allowed),
+ Rooms_pass = decide_rooms(Rooms_all, ServerHost, Last_allowed),
Num_rooms_all = length(Rooms_all),
Num_rooms_pass = length(Rooms_pass),
%%---------------
%% Decide
-decide_rooms(Rooms, Last_allowed) ->
- Decide = fun(R) -> decide_room(R, Last_allowed) end,
+decide_rooms(Rooms, ServerHost, Last_allowed) ->
+ Decide = fun(R) -> decide_room(R, ServerHost, Last_allowed) end,
lists:filter(Decide, Rooms).
-decide_room({_Room_name, _Host, Room_pid}, Last_allowed) ->
+decide_room({_Room_name, _Host, Room_pid}, ServerHost, Last_allowed) ->
C = get_room_config(Room_pid),
Persistent = C#config.persistent,
History = (S#state.history)#lqueue.queue,
Ts_now = calendar:universal_time(),
Ts_uptime = uptime_seconds(),
+ HistorySize = gen_mod:get_module_opt(ServerHost, mod_muc, history_size),
{Has_hist, Last} = case p1_queue:is_empty(History) of
+ true when HistorySize == 0 ->
+ {false, 0};
true ->
{false, Ts_uptime};
false ->