Comparison

plugins/mod_pep.lua @ 9099:974b25c27f24

mod_pep: Move subscriber check into 'presence' access model callback
author Kim Alvefur <zash@zash.se>
date Sat, 04 Aug 2018 03:13:26 +0200
parent 9097:ce2ba9f91c84
child 9103:d5a7d2697b19
comparison
equal deleted inserted replaced
9098:d5bc306e93aa 9099:974b25c27f24
238 broadcaster = get_broadcaster(username); 238 broadcaster = get_broadcaster(username);
239 itemcheck = is_item_stanza; 239 itemcheck = is_item_stanza;
240 get_affiliation = function (jid) 240 get_affiliation = function (jid)
241 if jid_bare(jid) == user_bare then 241 if jid_bare(jid) == user_bare then
242 return "owner"; 242 return "owner";
243 elseif subscription_presence(username, jid) then
244 return "subscriber";
245 end 243 end
246 end; 244 end;
245
246 access_models = {
247 presence = function (jid)
248 if subscription_presence(username, jid) then
249 return "subscriber";
250 end
251 end;
252 };
247 253
248 normalize_jid = jid_bare; 254 normalize_jid = jid_bare;
249 255
250 check_node_config = check_node_config; 256 check_node_config = check_node_config;
251 }); 257 });