mod_rest/jsonmap.lib.lua
changeset 4951 b171ddf1bc3e
parent 4939 a85efae90e21
child 5123 048e339706ba
equal deleted inserted replaced
4950:cc14bfec209b 4951:b171ddf1bc3e
   504 	-- XEP-0313 conveninece mapping
   504 	-- XEP-0313 conveninece mapping
   505 	if kind == "iq" and t_type == "set" and type(t.archive) == "table" and not t.archive.form then
   505 	if kind == "iq" and t_type == "set" and type(t.archive) == "table" and not t.archive.form then
   506 		local archive = t.archive;
   506 		local archive = t.archive;
   507 		if archive["with"] or archive["start"] or archive["end"] or archive["before-id"] or archive["after-id"]
   507 		if archive["with"] or archive["start"] or archive["end"] or archive["before-id"] or archive["after-id"]
   508 			or archive["ids"] then
   508 			or archive["ids"] then
       
   509 			if type(archive["ids"]) == "string" then
       
   510 				local ids = {};
       
   511 				for id in archive["ids"]:gmatch("[^,]+") do
       
   512 					table.insert(ids, id);
       
   513 				end
       
   514 				archive["ids"] = ids;
       
   515 			end
   509 			archive.form = {
   516 			archive.form = {
   510 				type = "submit";
   517 				type = "submit";
   511 				fields = {
   518 				fields = {
   512 					{ var = "FORM_TYPE"; values = { "urn:xmpp:mam:2" } };
   519 					{ var = "FORM_TYPE"; values = { "urn:xmpp:mam:2" } };
   513 					{ var = "with"; values = { archive["with"] } };
   520 					{ var = "with"; values = { archive["with"] } };