Comparison

plugins/mod_pubsub/mod_pubsub.lua @ 7717:9c8eb0239eef

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Sat, 05 Nov 2016 00:28:30 +0100
parent 6843:161cccfdf015
parent 7708:c420a38db5ef
child 7982:e30b0cbed472
comparison
equal deleted inserted replaced
7707:7bb1cc7278b6 7717:9c8eb0239eef
124 reply:tag("item", { jid = module.host, node = node, name = node_obj.config.name }):up(); 124 reply:tag("item", { jid = module.host, node = node, name = node_obj.config.name }):up();
125 end 125 end
126 end); 126 end);
127 127
128 local admin_aff = module:get_option_string("default_admin_affiliation", "owner"); 128 local admin_aff = module:get_option_string("default_admin_affiliation", "owner");
129 local unowned_aff = module:get_option_string("default_unowned_affiliation"); 129 local function get_affiliation(jid)
130 local function get_affiliation(jid, node)
131 local bare_jid = jid_bare(jid); 130 local bare_jid = jid_bare(jid);
132 if bare_jid == module.host or usermanager.is_admin(bare_jid, module.host) then 131 if bare_jid == module.host or usermanager.is_admin(bare_jid, module.host) then
133 return admin_aff; 132 return admin_aff;
134 end
135 if not node then
136 return unowned_aff;
137 end 133 end
138 end 134 end
139 135
140 function set_service(new_service) 136 function set_service(new_service)
141 service = new_service; 137 service = new_service;