# HG changeset patch # User Kim Alvefur # Date 1530893012 -7200 # Node ID b6cb0a8f75b1821f518f028c15efe23f3bf46eb9 # Parent 4d2738b99b07c6898eefe71ba608b3325f0abdeb mod_pubsub: Advertise title and description in disco#info diff -r 4d2738b99b07 -r b6cb0a8f75b1 plugins/mod_pubsub/pubsub.lib.lua --- a/plugins/mod_pubsub/pubsub.lib.lua Fri Jul 06 18:00:50 2018 +0200 +++ b/plugins/mod_pubsub/pubsub.lib.lua Fri Jul 06 18:03:32 2018 +0200 @@ -89,6 +89,22 @@ -- No options yet. File a feature request ;) }; +local node_metadata_form = dataform { + { + type = "hidden"; + name = "FORM_TYPE"; + value = "http://jabber.org/protocol/pubsub#meta-data"; + }; + { + type = "text-single"; + name = "pubsub#title"; + }; + { + type = "text-single"; + name = "pubsub#description"; + }; +}; + local service_method_feature_map = { add_subscription = { "subscribe" }; create = { "create-nodes", "instant-nodes", "item-ids", "create-and-configure" }; @@ -147,6 +163,12 @@ end event.exists = true; reply:tag("identity", { category = "pubsub", type = "leaf" }):up(); + if node_obj.config then + reply:add_child(node_metadata_form:form({ + ["pubsub#title"] = node_obj.config.title; + ["pubsub#description"] = node_obj.config.description; + }, "result")); + end end function _M.handle_disco_items_node(event, service)