aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-12-29 21:49:32 +0100
committerKim Alvefur <zash@zash.se>2018-12-29 21:49:32 +0100
commite23c17c3a040717e97287b3ea525002f1b58ffcd (patch)
tree498e285c672879ef0fb570aa419d07e536d58fb4 /util
parent5eb327274aa1ab27ec45b49e419943c264bd237d (diff)
parent9f19a48ee2c20e4269f3e3c53a9330bd25f48621 (diff)
downloadprosody-e23c17c3a040717e97287b3ea525002f1b58ffcd.tar.gz
prosody-e23c17c3a040717e97287b3ea525002f1b58ffcd.zip
Merge 0.11->trunk
Diffstat (limited to 'util')
-rw-r--r--util/pubsub.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua
index fafae50a..47e526a7 100644
--- a/util/pubsub.lua
+++ b/util/pubsub.lua
@@ -177,6 +177,20 @@ local function new(config)
for node_name in config.nodestore:users() do
service.nodes[node_name] = load_node_from_store(service, node_name);
service.data[node_name] = config.itemstore(service.nodes[node_name].config, node_name);
+
+ for jid in pairs(service.nodes[node_name].subscribers) do
+ local normal_jid = service.config.normalize_jid(jid);
+ local subs = service.subscriptions[normal_jid];
+ if subs then
+ if not subs[jid] then
+ subs[jid] = { [node_name] = true };
+ else
+ subs[jid][node_name] = true;
+ end
+ else
+ service.subscriptions[normal_jid] = { [jid] = { [node_name] = true } };
+ end
+ end
end
end