Mercurial > prosody-modules
comparison mod_muc_inject_mentions/mod_muc_inject_mentions.lua @ 4141:aef6f5b9f6fd
mod_muc_inject_mentions: (W311) value assigned to variable _first is overwritten on line 104 before use
author | Seve Ferrer <seve@delape.net> |
---|---|
date | Sun, 20 Sep 2020 13:45:32 +0200 |
parents | fea4a4831e10 |
children | 6906562af2ee |
comparison
equal
deleted
inserted
replaced
4140:fea4a4831e10 | 4141:aef6f5b9f6fd |
---|---|
94 for _, occupant in pairs(room._occupants) do | 94 for _, occupant in pairs(room._occupants) do |
95 local nick = jid_resource(occupant.nick); | 95 local nick = jid_resource(occupant.nick); |
96 -- Check for multiple mentions to the same nickname in a message | 96 -- Check for multiple mentions to the same nickname in a message |
97 -- Hey @nick remember to... Ah, also @nick please let me know if... | 97 -- Hey @nick remember to... Ah, also @nick please let me know if... |
98 local matches = {} | 98 local matches = {} |
99 local _first, _last = 0, 0 | 99 local _first |
100 local _last = 0 | |
100 while true do | 101 while true do |
101 -- Use plain search as nick could contain | 102 -- Use plain search as nick could contain |
102 -- characters used in Lua patterns | 103 -- characters used in Lua patterns |
103 _first, _last = body:find(nick, _last + 1, true) | 104 _first, _last = body:find(nick, _last + 1, true) |
104 if _first == nil then break end | 105 if _first == nil then break end |