util/stanza.lua
changeset 10447 f28718f46196
parent 10446 22db763c510c
child 10448 4eab1f5a4f3b
equal deleted inserted replaced
10446:22db763c510c 10447:f28718f46196
   436 local function reply(orig)
   436 local function reply(orig)
   437 	if not is_stanza(orig) then
   437 	if not is_stanza(orig) then
   438 		error("bad argument to reply: expected stanza, got "..type(orig));
   438 		error("bad argument to reply: expected stanza, got "..type(orig));
   439 	end
   439 	end
   440 	return new_stanza(orig.name,
   440 	return new_stanza(orig.name,
   441 		orig.attr and {
   441 		{
   442 			to = orig.attr.from,
   442 			to = orig.attr.from,
   443 			from = orig.attr.to,
   443 			from = orig.attr.to,
   444 			id = orig.attr.id,
   444 			id = orig.attr.id,
   445 			type = ((orig.name == "iq" and "result") or orig.attr.type)
   445 			type = ((orig.name == "iq" and "result") or orig.attr.type)
   446 		});
   446 		});