changeset 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 117a979ef930
files mod_rest/jsonmap.lib.lua
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 = {