comparison mod_rest/mod_rest.lua @ 4841:f69c5a443156

mod_rest: Fix nested message stanzas in XEP-0297 containers It's all a bit awkward because it doesn't normally use the whole schema directly, but rather checks which stanza type is used and picks out that property as a schema. Which also prevents references from working.
author Kim Alvefur <zash@zash.se>
date Wed, 29 Dec 2021 19:40:28 +0100
parents d29a295cd165
children dc7c9ae15f43
comparison
equal deleted inserted replaced
4840:e9b7c8db3ebd 4841:f69c5a443156
295 return post_errors.new("mediatype", ctx); 295 return post_errors.new("mediatype", ctx);
296 end 296 end
297 return post_errors.new("parse", ctx); 297 return post_errors.new("parse", ctx);
298 end 298 end
299 299
300 if payload.attr.xmlns then 300 if (payload.attr.xmlns or "jabber:client") ~= "jabber:client" then
301 return post_errors.new("xmlns"); 301 return post_errors.new("xmlns");
302 elseif payload.name ~= "message" and payload.name ~= "presence" and payload.name ~= "iq" then 302 elseif payload.name ~= "message" and payload.name ~= "presence" and payload.name ~= "iq" then
303 return post_errors.new("name"); 303 return post_errors.new("name");
304 end 304 end
305 305