Comparison

plugins/mod_storage_xep0227.lua @ 12185:708769a4c5da

mod_storage_xep0227: Fix luacheck warnings
author Matthew Wild <mwild1@gmail.com>
date Fri, 14 Jan 2022 17:00:13 +0000
parent 12184:326f5466ddc7
child 12188:0fee75871f78
comparison
equal deleted inserted replaced
12184:326f5466ddc7 12185:708769a4c5da
236 end; 236 end;
237 set = function(self, user, data) 237 set = function(self, user, data)
238 local xml = self:_get_user_xml(user, self.host); 238 local xml = self:_get_user_xml(user, self.host);
239 local usere = xml and getUserElement(xml); 239 local usere = xml and getUserElement(xml);
240 if usere then 240 if usere then
241 local user_jid = jid.join(usere.name, self.host); 241 local user_jid = jid_join(usere.name, self.host);
242 usere:remove_children("query", "jabber:iq:roster"); 242 usere:remove_children("query", "jabber:iq:roster");
243 usere:maptags(function (tag) 243 usere:maptags(function (tag)
244 if tag.attr.xmlns == "jabber:client" and tag.name == "presence" and tag.attr.type == "subscribe" then 244 if tag.attr.xmlns == "jabber:client" and tag.name == "presence" and tag.attr.type == "subscribe" then
245 return nil; 245 return nil;
246 end 246 end
248 end); 248 end);
249 if data and next(data) ~= nil then 249 if data and next(data) ~= nil then
250 local roster = st.stanza("query", {xmlns='jabber:iq:roster'}); 250 local roster = st.stanza("query", {xmlns='jabber:iq:roster'});
251 usere:add_child(roster); 251 usere:add_child(roster);
252 for contact_jid, item in pairs(data) do 252 for contact_jid, item in pairs(data) do
253 contact_jid = jid.bare(jid.prep(contact_jid)); 253 contact_jid = jid_bare(jid_prep(contact_jid));
254 if contact_jid ~= false then 254 if contact_jid ~= false then
255 if contact_jid ~= user_jid then -- Skip self-contacts 255 if contact_jid ~= user_jid then -- Skip self-contacts
256 roster:tag("item", { 256 roster:tag("item", {
257 jid = contact_jid, 257 jid = contact_jid,
258 subscription = item.subscription, 258 subscription = item.subscription,