Emoji only mode WIP:

Fix emojis regexp. The RCPE2 library can't handle long regexp, so we
switch to Oniguruma.
This commit is contained in:
John Livingston
2024-09-05 19:00:42 +02:00
parent 1a75b30c50
commit 5db4f46421
4 changed files with 15 additions and 43 deletions

View File

@ -11,7 +11,8 @@
local st = require "util.stanza";
local jid_bare = require "util.jid".bare;
local rex = require "rex_pcre2"; -- We are using PCRE2 (Perl Compatible Regular Expression)
local rex = require "rex_onig"; -- We are using Oniguruma because PCRE2 does not handle long regexp.
rex.setdefaultsyntax ("PERL");
-- Plugin dependencies
local mod_muc = module:depends "muc";
@ -87,7 +88,7 @@ function handle_groupchat(event)
if (r == nil) then
return;
end
room.x_peertubelivechat_emoji_only_compiled_regexp = rex.new(r, "i");
room.x_peertubelivechat_emoji_only_compiled_regexp = rex.new(r, "i", "UTF8");
end
-- only consider messages with body (ie: ignore chatstate and other non-text xmpp messages)