# HG changeset patch # User Seve Ferrer # Date 1600608249 -7200 # Node ID 837c4340653fcd3d5235590ab6a0d6ffd3766c83 # Parent 1c05671598ae4ad29fa42bd64c0b9be701d0eb38 mod_muc_inject_mentions: Catch nicknames between new lines diff -r 1c05671598ae -r 837c4340653f mod_muc_inject_mentions/mod_muc_inject_mentions.lua --- a/mod_muc_inject_mentions/mod_muc_inject_mentions.lua Sun Sep 20 15:04:22 2020 +0200 +++ b/mod_muc_inject_mentions/mod_muc_inject_mentions.lua Sun Sep 20 15:24:09 2020 +0200 @@ -119,9 +119,9 @@ if first == 1 and last == #body then table.insert(mentions, {bare_jid=bare_jid, first=first, last=last}) - -- Nickname between spaces - elseif body:sub(first - 1, first - 1) == " " and - body:sub(last + 1, last + 1) == " " + -- Nickname between spaces or new lines + elseif body:sub(first - 1, first - 1) == " " or body:sub(first - 1, first - 1) == "\n" and + body:sub(last + 1, last + 1) == " " or body:sub(last + 1, last + 1) == "\n" then table.insert(mentions, {bare_jid=bare_jid, first=first, last=last}) else