Moderation delay WIP (#132):

* default channel value for moderation delay
This commit is contained in:
John Livingston
2024-07-09 16:15:07 +02:00
parent 00a0dca1f9
commit 7a54594967
12 changed files with 92 additions and 3 deletions

View File

@ -97,6 +97,11 @@ local function update_room(event)
must104 = true;
end
end
if type(config.moderation_delay) == "number" then
if room._data.moderation_delay ~= config.moderation_delay then
room._data.moderation_delay = config.moderation_delay;
end
end
if (type(config.livechat_muc_terms) == "string") then
-- to easily detect if the value is given or not, we consider that the caller passes "" when terms must be deleted.
if set_muc_terms then

View File

@ -7,10 +7,13 @@
-- This version contains a modification to take into account new config options:
-- * "slow_mode_duration"
-- * "mute_anonymous"
-- * "moderation_delay"
-- These options are introduced in the Peertube livechat plugin.
--
-- The "slow_mode_duration" comes with mod_muc_slow_mode.
-- There will be a XEP proposal for this one. When done, these modifications will be submitted to the mod_muc_http_defaults maintainer.
--
-- The "moderation_delay" comes with mod_muc_moderation_delay
--
local http = require "net.http";
@ -116,7 +119,10 @@ local function apply_config(room, settings)
-- specific to peertube-plugin-livechat:
if (type(config.slow_mode_duration) == "number") and config.slow_mode_duration >= 0 then
room._data.slow_mode_duration = config.slow_mode_duration;
room._data.slow_mode_duration = config.slow_mode_duration;
end
if (type(config.moderation_delay) == "number") and config.moderation_delay >= 0 then
room._data.moderation_delay = config.moderation_delay;
end
if (type(config.mute_anonymous) == "boolean") then
room._data.x_peertubelivechat_mute_anonymous = config.mute_anonymous;