From bc2dc17d56a1a6f35177469c7122dfe577c3bf2c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 27 Sep 2014 19:00:09 +0200 Subject: mod_pep_plus: Add pubsub service objects to an item list --- plugins/mod_pep_plus.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'plugins/mod_pep_plus.lua') diff --git a/plugins/mod_pep_plus.lua b/plugins/mod_pep_plus.lua index 81dd3085..351b0e3c 100644 --- a/plugins/mod_pep_plus.lua +++ b/plugins/mod_pep_plus.lua @@ -55,10 +55,11 @@ local function get_broadcaster(name) end function get_pep_service(name) - if services[name] then - return services[name]; + local service = services[name]; + if service then + return service; end - services[name] = pubsub.new({ + service = pubsub.new({ capabilities = { none = { create = false; @@ -166,7 +167,9 @@ function get_pep_service(name) normalize_jid = jid_bare; }); - return services[name]; + services[name] = service; + module:add_item("pep-service", { service = service, jid = name }); + return service; end function handle_pubsub_iq(event) -- cgit v1.2.3