comparison mod_pastebin/mod_pastebin.lua @ 3346:03cbffd807bb

mod_pastebin: Convert limit values to strings (fixes traceback)
author Kim Alvefur <zash@zash.se>
date Wed, 03 Oct 2018 13:08:17 +0200
parents 4a12abccdbaf
children 09e7e880e056
comparison
equal deleted inserted replaced
3345:4a12abccdbaf 3346:03cbffd807bb
155 module:hook("muc-disco#info", function (event) 155 module:hook("muc-disco#info", function (event)
156 local reply, form, formdata = event.reply, event.form, event.formdata; 156 local reply, form, formdata = event.reply, event.form, event.formdata;
157 reply:tag("feature", { var = "https://modules.prosody.im/mod_pastebin" }):up(); 157 reply:tag("feature", { var = "https://modules.prosody.im/mod_pastebin" }):up();
158 table.insert(form, { name = "https://modules.prosody.im/mod_pastebin#max_lines", datatype = "xs:integer" }); 158 table.insert(form, { name = "https://modules.prosody.im/mod_pastebin#max_lines", datatype = "xs:integer" });
159 table.insert(form, { name = "https://modules.prosody.im/mod_pastebin#max_characters", datatype = "xs:integer" }); 159 table.insert(form, { name = "https://modules.prosody.im/mod_pastebin#max_characters", datatype = "xs:integer" });
160 formdata["https://modules.prosody.im/mod_pastebin#max_lines"] = line_threshold; 160 formdata["https://modules.prosody.im/mod_pastebin#max_lines"] = tostring(line_threshold);
161 formdata["https://modules.prosody.im/mod_pastebin#max_characters"] = length_threshold; 161 formdata["https://modules.prosody.im/mod_pastebin#max_characters"] = tostring(length_threshold);
162 end); 162 end);
163 163
164 function expire_pastes(time) 164 function expire_pastes(time)
165 time = time or os_time(); -- COMPAT with 0.5 165 time = time or os_time(); -- COMPAT with 0.5
166 if pastes[1] then 166 if pastes[1] then