Mercurial > prosody-hg
comparison plugins/mod_pubsub/pubsub.lib.lua @ 9039:0124e5ec1556
mod_pubsub: Move include_body option into subscription options
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 14 Jul 2018 19:34:10 +0200 |
| parents | fd053fcaf9bc |
| children | e993fad0cc62 |
comparison
equal
deleted
inserted
replaced
| 9038:fd053fcaf9bc | 9039:0124e5ec1556 |
|---|---|
| 44 ["pubsub#title"] = node_config["title"]; | 44 ["pubsub#title"] = node_config["title"]; |
| 45 ["pubsub#description"] = node_config["description"]; | 45 ["pubsub#description"] = node_config["description"]; |
| 46 ["pubsub#max_items"] = tostring(node_config["max_items"]); | 46 ["pubsub#max_items"] = tostring(node_config["max_items"]); |
| 47 ["pubsub#persist_items"] = node_config["persist_items"]; | 47 ["pubsub#persist_items"] = node_config["persist_items"]; |
| 48 ["pubsub#notification_type"] = node_config["notification_type"]; | 48 ["pubsub#notification_type"] = node_config["notification_type"]; |
| 49 ["pubsub#include_body"] = node_config["include_body"]; | |
| 50 } | 49 } |
| 51 end | 50 end |
| 52 | 51 |
| 53 local function config_from_xep0060(config) | 52 local function config_from_xep0060(config) |
| 54 return { | 53 return { |
| 55 ["title"] = config["pubsub#title"]; | 54 ["title"] = config["pubsub#title"]; |
| 56 ["description"] = config["pubsub#description"]; | 55 ["description"] = config["pubsub#description"]; |
| 57 ["max_items"] = tonumber(config["pubsub#max_items"]); | 56 ["max_items"] = tonumber(config["pubsub#max_items"]); |
| 58 ["persist_items"] = config["pubsub#persist_items"]; | 57 ["persist_items"] = config["pubsub#persist_items"]; |
| 59 ["notification_type"] = config["pubsub#notification_type"]; | 58 ["notification_type"] = config["pubsub#notification_type"]; |
| 60 ["include_body"] = config["pubsub#include_body"]; | |
| 61 } | 59 } |
| 62 end | 60 end |
| 63 | 61 |
| 64 local node_config_form = dataform { | 62 local node_config_form = dataform { |
| 65 { | 63 { |
| 84 }; | 82 }; |
| 85 { | 83 { |
| 86 type = "boolean"; | 84 type = "boolean"; |
| 87 name = "pubsub#persist_items"; | 85 name = "pubsub#persist_items"; |
| 88 label = "Persist items to storage"; | 86 label = "Persist items to storage"; |
| 89 }; | |
| 90 { | |
| 91 type = "boolean"; | |
| 92 name = "pubsub#include_body"; | |
| 93 label = "Receive message body in addition to payload?"; | |
| 94 }; | 87 }; |
| 95 { | 88 { |
| 96 type = "list-single"; | 89 type = "list-single"; |
| 97 name = "pubsub#notification_type"; | 90 name = "pubsub#notification_type"; |
| 98 label = "Specify the delivery style for notifications"; | 91 label = "Specify the delivery style for notifications"; |
| 106 local options_form = dataform { | 99 local options_form = dataform { |
| 107 { | 100 { |
| 108 type = "hidden"; | 101 type = "hidden"; |
| 109 name = "FORM_TYPE"; | 102 name = "FORM_TYPE"; |
| 110 value = "http://jabber.org/protocol/pubsub#subscribe_options"; | 103 value = "http://jabber.org/protocol/pubsub#subscribe_options"; |
| 111 } | 104 }; |
| 112 -- No options yet. File a feature request ;) | 105 { |
| 106 type = "boolean"; | |
| 107 name = "pubsub#include_body"; | |
| 108 label = "Receive message body in addition to payload?"; | |
| 109 }; | |
| 113 }; | 110 }; |
| 114 | 111 |
| 115 local node_metadata_form = dataform { | 112 local node_metadata_form = dataform { |
| 116 { | 113 { |
| 117 type = "hidden"; | 114 type = "hidden"; |
