mod_rest/jsonmap.lib.lua
changeset 4503 8e644bf36627
parent 4477 3b50a9a75fb6
child 4504 34c0f760f34a
equal deleted inserted replaced
4502:1776831d0fab 4503:8e644bf36627
   226 			-- else .. missing required attribute
   226 			-- else .. missing required attribute
   227 		end;
   227 		end;
   228 	};
   228 	};
   229 
   229 
   230 	-- XEP-0066: Out of Band Data
   230 	-- XEP-0066: Out of Band Data
   231 	oob_url = { type = "func", xmlns = "jabber:iq:oob", tagname = "query",
   231 	oob_url = { type = "func", xmlns = "jabber:x:oob", tagname = "query",
       
   232 		-- XXX namespace depends on whether it's in an iq or message stanza
   232 		st2json = function (s)
   233 		st2json = function (s)
   233 			return s:get_child_text("url");
   234 			return s:get_child_text("url");
   234 		end;
   235 		end;
   235 		json2st = function (s)
   236 		json2st = function (s)
   236 			if type(s) == "string" then
   237 			if type(s) == "string" then
   237 				return st.stanza("query", { xmlns = "jabber:iq:oob" }):text_tag("url", s);
   238 				return st.stanza("query", { xmlns = "jabber:x:oob" }):text_tag("url", s);
   238 			end
   239 			end
   239 		end;
   240 		end;
   240 	};
   241 	};
   241 
   242 
   242 	-- XEP-0432: Simple JSON Messaging
   243 	-- XEP-0432: Simple JSON Messaging