# HG changeset patch # User Kim Alvefur # Date 1533427022 -7200 # Node ID 2c1d68b54c91c2ce162eaa07a15cb8340db305c3 # Parent 2aaa192e3da568862372eb216571cb74e3bd433f mod_pep: Save non-presence based subscriptions to storage diff -r 2aaa192e3da5 -r 2c1d68b54c91 plugins/mod_pep.lua --- a/plugins/mod_pep.lua Sun Aug 05 01:56:36 2018 +0200 +++ b/plugins/mod_pep.lua Sun Aug 05 01:57:02 2018 +0200 @@ -81,12 +81,17 @@ function store:set(node, data) if data then -- Save the data without subscriptions - -- TODO Save explicit subscriptions maybe? + local subscribers = {}; + for jid, sub in pairs(data.subscribers) do + if type(sub) ~= "table" or not sub.presence then + subscribers[jid] = sub; + end + end data = { name = data.name; config = data.config; affiliations = data.affiliations; - subscribers = {}; + subscribers = subscribers; }; end return node_config:set(username, node, data);