Comparison

mod_pastebin/mod_pastebin.lua @ 3868:09e7e880e056

mod_pastebin: Follow XEP-0068 and use Clark notation in disco#info
author Kim Alvefur <zash@zash.se>
date Sun, 26 Jan 2020 16:49:14 +0100
parent 3346:03cbffd807bb
child 4700:f821eeac0e50
comparison
equal deleted inserted replaced
3867:839224be5299 3868:09e7e880e056
153 end 153 end
154 154
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"] = tostring(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"] = tostring(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