Comparison

plugins/mod_pep_plus.lua @ 8218:2c75a5ba58fc

mod_pubsub: Pass 'user' to simple_itemstore
author Kim Alvefur <zash@zash.se>
date Wed, 26 Apr 2017 12:09:58 +0200
parent 8215:835bb32c36b4
child 8300:7759eb130938
comparison
equal deleted inserted replaced
8217:5f4e0d67b82a 8218:2c75a5ba58fc
34 if (recipient_bare == user_bare) then return true; end 34 if (recipient_bare == user_bare) then return true; end
35 local username, host = jid_split(user_bare); 35 local username, host = jid_split(user_bare);
36 return is_contact_subscribed(username, host, recipient_bare); 36 return is_contact_subscribed(username, host, recipient_bare);
37 end 37 end
38 38
39 local function simple_itemstore(config, node) 39 local function simple_itemstore(user)
40 return lib_pubsub.simple_itemstore(archive, config, node, false); 40 return function (config, node)
41 return lib_pubsub.simple_itemstore(archive, config, user, node, false);
42 end
41 end 43 end
42 44
43 local function get_broadcaster(name) 45 local function get_broadcaster(name)
44 local function simple_broadcast(kind, node, jids, item) 46 local function simple_broadcast(kind, node, jids, item)
45 if item then 47 if item then
164 }; 166 };
165 167
166 autocreate_on_publish = true; 168 autocreate_on_publish = true;
167 autocreate_on_subscribe = true; 169 autocreate_on_subscribe = true;
168 170
169 itemstore = simple_itemstore; 171 itemstore = simple_itemstore(name);
170 broadcaster = get_broadcaster(name); 172 broadcaster = get_broadcaster(name);
171 get_affiliation = function (jid) 173 get_affiliation = function (jid)
172 if jid_bare(jid) == name then 174 if jid_bare(jid) == name then
173 return "owner"; 175 return "owner";
174 elseif subscription_presence(name, jid) then 176 elseif subscription_presence(name, jid) then