mod_rest: Support mapping XEP-0004 Data Forms directly
authorKim Alvefur <zash@zash.se>
Sat, 08 Feb 2020 14:38:23 +0100
changeset 3893 59765d1bb6dc
parent 3892 04ea96a0488d
child 3894 117a979ef930
mod_rest: Support mapping XEP-0004 Data Forms directly
mod_rest/jsonmap.lib.lua
--- a/mod_rest/jsonmap.lib.lua	Fri Feb 07 22:30:38 2020 +0100
+++ b/mod_rest/jsonmap.lib.lua	Sat Feb 08 14:38:23 2020 +0100
@@ -336,6 +336,18 @@
 		end
 	};
 
+	-- XEP-0004: Data Forms
+	dataform = dataform;
+
+	-- Simpler mapping from JSON map
+	formdata = {"func", "jabber:x:data", "",
+		function ()
+			-- Tricky to do in a generic way without each form layout
+			-- In the future, some well-known layouts might be understood
+			return nil, "not-implemented";
+		end,
+		formdata,
+	};
 };
 
 local implied_kinds = {