comparison mod_muc_inject_mentions/mod_muc_inject_mentions.lua @ 4140:fea4a4831e10

mod_muc_inject_mentions: (W211) unused variable node, (W211) unused variable host
author Seve Ferrer <seve@delape.net>
date Sun, 20 Sep 2020 13:38:31 +0200
parents c6bb64a12f92
children aef6f5b9f6fd
comparison
equal deleted inserted replaced
4139:c6bb64a12f92 4140:fea4a4831e10
1 module:depends("muc"); 1 module:depends("muc");
2 2
3 local jid_split = require "util.jid".split; 3 local jid_resource = require "util.jid".resource;
4 4
5 local prefixes = module:get_option("muc_inject_mentions_prefixes", nil) 5 local prefixes = module:get_option("muc_inject_mentions_prefixes", nil)
6 local suffixes = module:get_option("muc_inject_mentions_suffixes", nil) 6 local suffixes = module:get_option("muc_inject_mentions_suffixes", nil)
7 local enabled_rooms = module:get_option("muc_inject_mentions_enabled_rooms", nil) 7 local enabled_rooms = module:get_option("muc_inject_mentions_enabled_rooms", nil)
8 local disabled_rooms = module:get_option("muc_inject_mentions_disabled_rooms", nil) 8 local disabled_rooms = module:get_option("muc_inject_mentions_disabled_rooms", nil)
90 local function search_mentions(room, stanza) 90 local function search_mentions(room, stanza)
91 local body = stanza:get_child("body"):get_text(); 91 local body = stanza:get_child("body"):get_text();
92 local mentions = {} 92 local mentions = {}
93 93
94 for _, occupant in pairs(room._occupants) do 94 for _, occupant in pairs(room._occupants) do
95 local node, host, nick = jid_split(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, _last = 0, 0
100 while true do 100 while true do