From 86f786bae51f938cd7c224e87f48f97ee1fb02ce Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 5 Aug 2018 01:57:02 +0200 Subject: mod_pep: Save non-presence based subscriptions to storage --- plugins/mod_pep.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index 42a01305..1d81c82f 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -81,12 +81,17 @@ local function nodestore(username) 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); -- cgit v1.2.3