aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/pubsub.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-07-06 18:03:32 +0200
committerKim Alvefur <zash@zash.se>2018-07-06 18:03:32 +0200
commitb7ac5365ab43426925fdb2c820a6bfcc3b76140e (patch)
tree6a23f3a45dc6ea60c0f4c417175e09a8f87d275c /plugins/mod_pubsub/pubsub.lib.lua
parenteb28cd503ff82b386824e3329a1a6a0d0d1f10e3 (diff)
downloadprosody-b7ac5365ab43426925fdb2c820a6bfcc3b76140e.tar.gz
prosody-b7ac5365ab43426925fdb2c820a6bfcc3b76140e.zip
mod_pubsub: Advertise title and description in disco#info
Diffstat (limited to 'plugins/mod_pubsub/pubsub.lib.lua')
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index 83fba1fc..82c44a16 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -89,6 +89,22 @@ local options_form = dataform {
-- 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 @@ function _M.handle_disco_info_node(event, service)
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)