Emoji only mode WIP:

* refactoring + optimization
* migration
This commit is contained in:
John Livingston
2024-09-06 11:01:48 +02:00
parent b115c28ee7
commit 08017ac2bb
12 changed files with 172 additions and 50 deletions

View File

@ -18,7 +18,7 @@ local mod_muc_peertubelivechat_terms = module:depends"muc_peertubelivechat_terms
local set_muc_terms = rawget(mod_muc_peertubelivechat_terms, "set_muc_terms");
local mod_muc_peertubelivechat_restrict_message = module:depends"muc_peertubelivechat_restrict_message";
local set_peertubelivechat_emoji_only_mode = rawget(mod_muc_peertubelivechat_restrict_message, "set_peertubelivechat_emoji_only_mode");
local set_peertubelivechat_emoji_only_regexp = rawget(mod_muc_peertubelivechat_restrict_message, "set_peertubelivechat_emoji_only_regexp");
local set_peertubelivechat_custom_emoji_regexp = rawget(mod_muc_peertubelivechat_restrict_message, "set_peertubelivechat_custom_emoji_regexp");
function check_auth(routes)
local function check_request_auth(event)
@ -110,9 +110,9 @@ local function update_room(event)
set_peertubelivechat_emoji_only_mode(room, config.livechat_emoji_only)
end
end
if type(config.livechat_emoji_only_regexp) == "string" then
if set_peertubelivechat_emoji_only_mode then
set_peertubelivechat_emoji_only_regexp(room, config.livechat_emoji_only_regexp)
if type(config.livechat_custom_emoji_regexp) == "string" then
if set_peertubelivechat_custom_emoji_regexp then
set_peertubelivechat_custom_emoji_regexp(room, config.livechat_custom_emoji_regexp)
end
end
if (type(config.livechat_muc_terms) == "string") then