Comparison

plugins/mod_pubsub/pubsub.lib.lua @ 9130:74525b8104d5

pubsub.lib: Add support for pubsub#publish_model
author Matthew Wild <mwild1@gmail.com>
date Mon, 06 Aug 2018 11:23:42 +0100
parent 9128:a4a923e493da
child 9131:d0d676b86013
comparison
equal deleted inserted replaced
9129:7721794e9e93 9130:74525b8104d5
84 { value = "whitelist" }; 84 { value = "whitelist" };
85 }; 85 };
86 }; 86 };
87 { 87 {
88 type = "list-single"; 88 type = "list-single";
89 name = "pubsub#publish_model";
90 label = "Specify the publisher model";
91 options = {
92 { value = "publishers" };
93 { value = "subscribers" };
94 { value = "open" };
95 };
96 };
97 {
98 type = "list-single";
89 name = "pubsub#notification_type"; 99 name = "pubsub#notification_type";
90 label = "Specify the delivery style for notifications"; 100 label = "Specify the delivery style for notifications";
91 options = { 101 options = {
92 { label = "Messages of type normal", value = "normal" }, 102 { label = "Messages of type normal", value = "normal" },
93 { label = "Messages of type headline", value = "headline", default = true }, 103 { label = "Messages of type headline", value = "headline", default = true },
129 description = "pubsub#description"; 139 description = "pubsub#description";
130 max_items = "pubsub#max_items"; 140 max_items = "pubsub#max_items";
131 persist_items = "pubsub#persist_items"; 141 persist_items = "pubsub#persist_items";
132 notification_type = "pubsub#notification_type"; 142 notification_type = "pubsub#notification_type";
133 access_model = "pubsub#access_model"; 143 access_model = "pubsub#access_model";
144 publish_model = "pubsub#publish_model";
134 }; 145 };
135 local reverse_config_field_map = {}; 146 local reverse_config_field_map = {};
136 for k, v in pairs(config_field_map) do reverse_config_field_map[v] = k; end 147 for k, v in pairs(config_field_map) do reverse_config_field_map[v] = k; end
137 148
138 -- util.pubsub is meant to be agnostic to XEP-0060 149 -- util.pubsub is meant to be agnostic to XEP-0060
142 ["pubsub#description"] = node_config["description"]; 153 ["pubsub#description"] = node_config["description"];
143 ["pubsub#max_items"] = tostring(node_config["max_items"]); 154 ["pubsub#max_items"] = tostring(node_config["max_items"]);
144 ["pubsub#persist_items"] = node_config["persist_items"]; 155 ["pubsub#persist_items"] = node_config["persist_items"];
145 ["pubsub#notification_type"] = node_config["notification_type"]; 156 ["pubsub#notification_type"] = node_config["notification_type"];
146 ["pubsub#access_model"] = node_config["access_model"]; 157 ["pubsub#access_model"] = node_config["access_model"];
158 ["pubsub#publish_model"] = node_config["publish_model"];
147 } 159 }
148 end 160 end
149 161
150 local function config_from_xep0060(config, strict) 162 local function config_from_xep0060(config, strict)
151 local ret = {}; 163 local ret = {};