Software /
code /
prosody
Comparison
plugins/mod_pubsub/pubsub.lib.lua @ 9184:9fbddb80803b
mod_pubsub: Make notification of item retraction configurable
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 16 Aug 2018 14:44:09 +0200 |
parent | 9183:8239f24e38df |
child | 9185:60f163e7a7a7 |
comparison
equal
deleted
inserted
replaced
9183:8239f24e38df | 9184:9fbddb80803b |
---|---|
114 { | 114 { |
115 type = "boolean"; | 115 type = "boolean"; |
116 label = "Whether to notify subscribers when the node is deleted"; | 116 label = "Whether to notify subscribers when the node is deleted"; |
117 name = "pubsub#notify_delete"; | 117 name = "pubsub#notify_delete"; |
118 }; | 118 }; |
119 { | |
120 type = "boolean"; | |
121 label = "Whether to notify subscribers when items are removed from the node"; | |
122 name = "pubsub#notify_retract"; | |
123 }; | |
119 }; | 124 }; |
120 | 125 |
121 local subscribe_options_form = dataform { | 126 local subscribe_options_form = dataform { |
122 { | 127 { |
123 type = "hidden"; | 128 type = "hidden"; |
160 notification_type = "pubsub#notification_type"; | 165 notification_type = "pubsub#notification_type"; |
161 access_model = "pubsub#access_model"; | 166 access_model = "pubsub#access_model"; |
162 publish_model = "pubsub#publish_model"; | 167 publish_model = "pubsub#publish_model"; |
163 notify_items = "pubsub#deliver_notifications"; | 168 notify_items = "pubsub#deliver_notifications"; |
164 notify_delete = "pubsub#notify_delete"; | 169 notify_delete = "pubsub#notify_delete"; |
170 notify_retract = "pubsub#notify_retract"; | |
165 }; | 171 }; |
166 local reverse_config_field_map = {}; | 172 local reverse_config_field_map = {}; |
167 for k, v in pairs(config_field_map) do reverse_config_field_map[v] = k; end | 173 for k, v in pairs(config_field_map) do reverse_config_field_map[v] = k; end |
168 | 174 |
169 -- util.pubsub is meant to be agnostic to XEP-0060 | 175 -- util.pubsub is meant to be agnostic to XEP-0060 |
177 ["pubsub#notification_type"] = node_config["notification_type"]; | 183 ["pubsub#notification_type"] = node_config["notification_type"]; |
178 ["pubsub#access_model"] = node_config["access_model"]; | 184 ["pubsub#access_model"] = node_config["access_model"]; |
179 ["pubsub#publish_model"] = node_config["publish_model"]; | 185 ["pubsub#publish_model"] = node_config["publish_model"]; |
180 ["pubsub#deliver_notifications"] = node_config["notify_items"]; | 186 ["pubsub#deliver_notifications"] = node_config["notify_items"]; |
181 ["pubsub#notify_delete"] = node_config["notify_delete"]; | 187 ["pubsub#notify_delete"] = node_config["notify_delete"]; |
188 ["pubsub#notify_retract"] = node_config["notify_retract"]; | |
182 } | 189 } |
183 end | 190 end |
184 | 191 |
185 local function config_from_xep0060(config, strict) | 192 local function config_from_xep0060(config, strict) |
186 local ret = {}; | 193 local ret = {}; |