mod_muc_inject_mentions: Allow suffixes to be used before a new line
authorSeve Ferrer <seve@delape.net>
Sun, 20 Sep 2020 14:57:55 +0200
changeset 4147 b2080f76e0aa
parent 4146 6906562af2ee
child 4148 1c05671598ae
mod_muc_inject_mentions: Allow suffixes to be used before a new line
mod_muc_inject_mentions/mod_muc_inject_mentions.lua
--- 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