Comparison

plugins/muc/mod_muc.lua @ 13209:c8d949cf6b09

plugins: Switch to :get_option_period() for time range options Improves readability ("1 day" vs 86400) and centralizes validation.
author Kim Alvefur <zash@zash.se>
date Sun, 16 Jul 2023 20:49:33 +0200
parent 13170:082c7d856e61
child 13213:50324f66ca2a
comparison
equal deleted inserted replaced
13208:a7c6ea1c5308 13209:c8d949cf6b09
387 delete_room(room); 387 delete_room(room);
388 end); 388 end);
389 389
390 if module:get_option_boolean("muc_tombstones", true) then 390 if module:get_option_boolean("muc_tombstones", true) then
391 391
392 local ttl = module:get_option_number("muc_tombstone_expiry", 86400 * 31); 392 local ttl = module:get_option_period("muc_tombstone_expiry", "31 days");
393 393
394 module:hook("muc-room-destroyed",function(event) 394 module:hook("muc-room-destroyed",function(event)
395 local room = event.room; 395 local room = event.room;
396 if not room:get_persistent() then return end 396 if not room:get_persistent() then return end
397 if room._data.destroyed then 397 if room._data.destroyed then