comparison mod_omemo_all_access/mod_omemo_all_access.lua @ 2858:150a7bd59043

mod_omemo_all_access: fixed some linter warnings
author Daniel Gultsch <daniel@gultsch.de>
date Sun, 31 Dec 2017 13:15:53 +0100
parents 08f6b9d37a49
children 5b02241a254e
comparison
equal deleted inserted replaced
2857:ff1666716d10 2858:150a7bd59043
25 if payload and payload.name == 'items' then 25 if payload and payload.name == 'items' then
26 node = payload.attr.node 26 node = payload.attr.node
27 local item = payload.tags[1]; 27 local item = payload.tags[1];
28 if item and item.name == 'item' then 28 if item and item.name == 'item' then
29 requested_id = item.attr.id; 29 requested_id = item.attr.id;
30 end 30 end
31 end 31 end
32 if node and string.sub(node,1,string.len(white_listed_namespace)) == white_listed_namespace then 32 if node and string.sub(node,1,string.len(white_listed_namespace)) == white_listed_namespace then
33 local user = stanza.attr.to and jid_bare(stanza.attr.to) or session.username..'@'..session.host; 33 local user = stanza.attr.to and jid_bare(stanza.attr.to) or session.username..'@'..session.host;
34 local user_data = pep_data[user]; 34 local user_data = pep_data[user];
35 if user_data and user_data[node] then 35 if user_data and user_data[node] then
36 local id, item = unpack(user_data[node]); 36 local id, item = unpack(user_data[node]);
37 if not requested_id or id == requested_id then 37 if not requested_id or id == requested_id then
38 local stanza = st.reply(stanza) 38 local reply_stanza = st.reply(stanza)
39 :tag('pubsub', {xmlns='http://jabber.org/protocol/pubsub'}) 39 :tag('pubsub', {xmlns='http://jabber.org/protocol/pubsub'})
40 :tag('items', {node=node}) 40 :tag('items', {node=node})
41 :add_child(item) 41 :add_child(item)
42 :up() 42 :up()
43 :up(); 43 :up();
44 session.send(stanza); 44 session.send(reply_stanza);
45 module:log("debug","provided access to omemo node",node) 45 module:log("debug","provided access to omemo node",node)
46 return true; 46 return true;
47 end 47 end
48 end 48 end
49 module:log("debug","requested node was white listed", node) 49 module:log("debug","requested node was white listed", node)