def set_history(self, parameters):
for child in xml_element_iter(self.xmlnode.children):<EOL><INDENT>if get_node_ns_uri(child) == MUC_NS and child.name == "<STR_LIT>":<EOL><INDENT>child.unlinkNode()<EOL>child.freeNode()<EOL>break<EOL><DEDENT><DEDENT>if parameters.maxchars and parameters.maxchars < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if parameters.maxstanzas and parameters.maxstanzas < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if parameters.maxseconds and parameters.maxseconds < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>hnode=self.xmlnode.newChild(self.xmlnode.ns(), "<STR_LIT>", None)<EOL>if parameters.maxchars is not None:<EOL><INDENT>hnode.setProp("<STR_LIT>", str(parameters.maxchars))<EOL><DEDENT>if parameters.maxstanzas is not None:<EOL><INDENT>hnode.setProp("<STR_LIT>", str(parameters.maxstanzas))<EOL><DEDENT>if parameters.maxseconds is not None:<EOL><INDENT>hnode.setProp("<STR_LIT>", str(parameters.maxseconds))<EOL><DEDENT>if parameters.since is not None:<EOL><INDENT>hnode.setProp("<STR_LIT>", parameters.since.strftime("<STR_LIT>"))<EOL><DEDENT>
Set history parameters.

Types:
    - `parameters`: `HistoryParameters`