Software / code / prosody
Comparison
plugins/mod_pubsub/pubsub.lib.lua @ 9127:decad04ec184
pubsub.lib: Add comment about tonumber hack
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 06 Aug 2018 08:39:46 +0100 |
| parent | 9126:3dd5034a3233 |
| child | 9128:a4a923e493da |
comparison
equal
deleted
inserted
replaced
| 9126:3dd5034a3233 | 9127:decad04ec184 |
|---|---|
| 150 local function config_from_xep0060(config, strict) | 150 local function config_from_xep0060(config, strict) |
| 151 local ret = {}; | 151 local ret = {}; |
| 152 for config_field, config_value in pairs(config) do | 152 for config_field, config_value in pairs(config) do |
| 153 local mapped_name = reverse_config_field_map[config_field]; | 153 local mapped_name = reverse_config_field_map[config_field]; |
| 154 if mapped_name then | 154 if mapped_name then |
| 155 -- FIXME: The intention is to add "subtype" support to | |
| 156 -- util.dataforms, which will remove the need for this | |
| 157 -- ugly hack | |
| 155 if mapped_name == "max_items" then | 158 if mapped_name == "max_items" then |
| 156 config_value = tonumber(config_value); | 159 config_value = tonumber(config_value); |
| 157 end | 160 end |
| 158 ret[mapped_name] = config_value; | 161 ret[mapped_name] = config_value; |
| 159 elseif strict and config_field ~= "FORM_TYPE" then | 162 elseif strict and config_field ~= "FORM_TYPE" then |