comparison mod_rest/jsonmap.lib.lua @ 3889:59765d1bb6dc

mod_rest: Support mapping XEP-0004 Data Forms directly
author Kim Alvefur <zash@zash.se>
date Sat, 08 Feb 2020 14:38:23 +0100
parents 04ea96a0488d
children 14a32224900c
comparison
equal deleted inserted replaced
3888:04ea96a0488d 3889:59765d1bb6dc
334 :tag("json", { xmlns = "urn:xmpp:json:0" }):text(json.encode(s.data)); 334 :tag("json", { xmlns = "urn:xmpp:json:0" }):text(json.encode(s.data));
335 end; 335 end;
336 end 336 end
337 }; 337 };
338 338
339 -- XEP-0004: Data Forms
340 dataform = dataform;
341
342 -- Simpler mapping from JSON map
343 formdata = {"func", "jabber:x:data", "",
344 function ()
345 -- Tricky to do in a generic way without each form layout
346 -- In the future, some well-known layouts might be understood
347 return nil, "not-implemented";
348 end,
349 formdata,
350 };
339 }; 351 };
340 352
341 local implied_kinds = { 353 local implied_kinds = {
342 disco = "iq", 354 disco = "iq",
343 items = "iq", 355 items = "iq",