From 533cefaaf10bed012cbfb1f92cc9a7a5235bfec0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 16 Aug 2018 15:20:29 +0200 Subject: mod_pubsub: Add support for thin notifications (without the full payload) --- plugins/mod_pubsub/pubsub.lib.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins/mod_pubsub/pubsub.lib.lua') diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index 1850c54c..5c3b1e89 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -103,6 +103,11 @@ local node_config_form = dataform { label = "Whether to deliver event notifications"; name = "pubsub#deliver_notifications"; }; + { + type = "boolean"; + label = "Whether to deliver payloads with event notifications"; + name = "pubsub#deliver_payloads"; + }; { type = "list-single"; name = "pubsub#notification_type"; @@ -171,6 +176,7 @@ local config_field_map = { notify_items = "pubsub#deliver_notifications"; notify_delete = "pubsub#notify_delete"; notify_retract = "pubsub#notify_retract"; + include_payload = "pubsub#deliver_payloads"; }; local reverse_config_field_map = {}; for k, v in pairs(config_field_map) do reverse_config_field_map[v] = k; end @@ -189,6 +195,7 @@ local function config_to_xep0060(node_config) ["pubsub#deliver_notifications"] = node_config["notify_items"]; ["pubsub#notify_delete"] = node_config["notify_delete"]; ["pubsub#notify_retract"] = node_config["notify_retract"]; + ["pubsub#deliver_payloads"] = node_config["include_payload"] } end -- cgit v1.2.3