Changeset

4143:b2080f76e0aa

mod_muc_inject_mentions: Allow suffixes to be used before a new line
author Seve Ferrer <seve@delape.net>
date Sun, 20 Sep 2020 14:57:55 +0200
parents 4142:6906562af2ee
children 4144:1c05671598ae
files mod_muc_inject_mentions/mod_muc_inject_mentions.lua
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_inject_mentions/mod_muc_inject_mentions.lua	Sun Sep 20 14:45:58 2020 +0200
+++ b/mod_muc_inject_mentions/mod_muc_inject_mentions.lua	Sun Sep 20 14:57:55 2020 +0200
@@ -71,10 +71,12 @@
     -- There are no configured suffixes
     if not suffixes or #suffixes < 1 then return false end
 
-    -- Suffix must have a space after it
-    -- or be the last character of the body
+    -- Suffix must have a space after it,
+    -- be the last character of the body
+    -- or be the last character before a new line
     if body:sub(last + 2, last + 2) ~= "" and
-        body:sub(last + 2, last + 2) ~= " "
+        body:sub(last + 2, last + 2) ~= " " and
+        body:sub(last + 2, last + 2) ~= "\n"
     then
         return false
     end