# HG changeset patch
# User Marco Cirillo <maranda@lightwitch.org>
# Date 1302116444 -3600
# Node ID d0767040236fc0b9faaf5b0f9feb6ccb97122d3c
# Parent  2494d299d8a25b45d5809951b0b17c33f59f60ac
mod_pubsub: Support for setting a disco name

diff -r 2494d299d8a2 -r d0767040236f plugins/mod_pubsub.lua
--- a/plugins/mod_pubsub.lua	Wed Apr 06 14:48:00 2011 +0100
+++ b/plugins/mod_pubsub.lua	Wed Apr 06 20:00:44 2011 +0100
@@ -9,6 +9,8 @@
 
 local autocreate_on_publish = module:get_option_boolean("autocreate_on_publish", false);
 local autocreate_on_subscribe = module:get_option_boolean("autocreate_on_subscribe", false);
+local pubsub_disco_name = module:get_option("name");
+if type(pubsub_disco_name) ~= "string" then pubsub_disco_name = "Prosody PubSub Service"; end
 
 local service;
 
@@ -217,7 +219,7 @@
 
 local function build_disco_info(service)
 	local disco_info = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#info" })
-		:tag("identity", { category = "pubsub", type = "service" }):up()
+		:tag("identity", { category = "pubsub", type = "service", name = pubsub_disco_name }):up()
 		:tag("feature", { var = "http://jabber.org/protocol/pubsub" }):up();
 	add_disco_features_from_service(disco_info, service);
 	return disco_info;
@@ -359,4 +361,4 @@
 	get_affiliation = get_affiliation;
 	
 	normalize_jid = jid_bare;
-}));
+}));
\ No newline at end of file