Comparison

plugins/mod_muc_mam.lua @ 12858:71dc48a89e5a 0.12

mod_muc_mam: Add mam#extended form fields #1796 (Thanks Rain) Oversight in cabb022f31c0
author Kim Alvefur <zash@zash.se>
date Sat, 21 Jan 2023 17:09:22 +0100
parent 12857:cc86d77481fc
child 12859:cd738fb8c754
comparison
equal deleted inserted replaced
12857:cc86d77481fc 12858:71dc48a89e5a
106 { name = "FORM_TYPE"; type = "hidden"; value = xmlns_mam }; 106 { name = "FORM_TYPE"; type = "hidden"; value = xmlns_mam };
107 { name = "with"; type = "jid-single" }; 107 { name = "with"; type = "jid-single" };
108 { name = "start"; type = "text-single"; datatype = "xs:dateTime" }; 108 { name = "start"; type = "text-single"; datatype = "xs:dateTime" };
109 { name = "end"; type = "text-single"; datatype = "xs:dateTime" }; 109 { name = "end"; type = "text-single"; datatype = "xs:dateTime" };
110 }; 110 };
111
112 if archive.caps and archive.caps.full_id_range then
113 table.insert(query_form, { name = "before-id"; type = "text-single"; });
114 table.insert(query_form, { name = "after-id"; type = "text-single"; });
115 end
116
117 if archive.caps and archive.caps.ids then
118 table.insert(query_form, { name = "ids"; type = "list-multi"; });
119 end
120
111 121
112 -- Serve form 122 -- Serve form
113 module:hook("iq-get/bare/"..xmlns_mam..":query", function(event) 123 module:hook("iq-get/bare/"..xmlns_mam..":query", function(event)
114 local origin, stanza = event.origin, event.stanza; 124 local origin, stanza = event.origin, event.stanza;
115 origin.send(st.reply(stanza):query(xmlns_mam):add_child(query_form:form())); 125 origin.send(st.reply(stanza):query(xmlns_mam):add_child(query_form:form()));