comparison mod_muc_inject_mentions/mod_muc_inject_mentions.lua @ 4144:1c05671598ae

mod_muc_inject_mentions: Allow suffixes to be used after a new line
author Seve Ferrer <seve@delape.net>
date Sun, 20 Sep 2020 15:04:22 +0200
parents b2080f76e0aa
children 837c4340653f
comparison
equal deleted inserted replaced
4143:b2080f76e0aa 4144:1c05671598ae
141 table.insert(mentions, {bare_jid=bare_jid, first=first, last=last}) 141 table.insert(mentions, {bare_jid=bare_jid, first=first, last=last})
142 end 142 end
143 143
144 -- nickname: ... 144 -- nickname: ...
145 elseif not has_preffix and has_suffix then 145 elseif not has_preffix and has_suffix then
146 if body:sub(first - 1, first - 1) == " " then 146 if body:sub(first - 1, first - 1) == " " or
147 body:sub(first - 1, first - 1) == "\n"
148 then
147 table.insert(mentions, {bare_jid=bare_jid, first=first, last=last}) 149 table.insert(mentions, {bare_jid=bare_jid, first=first, last=last})
148 end 150 end
149 end 151 end
150 end 152 end
151 end 153 end