util/stanza.lua
changeset 11087 4d12a6785531
parent 11086 c26599a78fae
child 11088 5e09a3389adb
equal deleted inserted replaced
11086:c26599a78fae 11087:4d12a6785531
   454 		error("bad argument to error_reply: got stanza of type error which must not be replied to");
   454 		error("bad argument to error_reply: got stanza of type error which must not be replied to");
   455 	end
   455 	end
   456 	local t = reply(orig);
   456 	local t = reply(orig);
   457 	t.attr.type = "error";
   457 	t.attr.type = "error";
   458 	if type(error_type) == "table" then -- an util.error or similar object
   458 	if type(error_type) == "table" then -- an util.error or similar object
       
   459 		if type(error_type.extra) == "table" then
       
   460 			if type(error_type.extra.by) == "string" then error_by = error_type.extra.by; end
       
   461 		end
   459 		error_type, condition, error_message = error_type.type, error_type.condition, error_type.text;
   462 		error_type, condition, error_message = error_type.type, error_type.condition, error_type.text;
   460 	end
   463 	end
   461 	if t.attr.from == error_by then
   464 	if t.attr.from == error_by then
   462 		error_by = nil;
   465 		error_by = nil;
   463 	end
   466 	end