Diff

plugins/mod_pep_plus.lua @ 6432:388786af0dd2

mod_pep_plus: Add pubsub service objects to an item list
author Kim Alvefur <zash@zash.se>
date Sat, 27 Sep 2014 19:00:09 +0200
parent 6305:38d82f8ead25
child 6443:f4403c270ea2
line wrap: on
line diff
--- a/plugins/mod_pep_plus.lua	Fri Sep 26 17:34:15 2014 +0100
+++ b/plugins/mod_pep_plus.lua	Sat Sep 27 19:00:09 2014 +0200
@@ -55,10 +55,11 @@
 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 @@
 
 		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)