muc/user: Add a constructor for Item.

This commit is contained in:
Emmanuel Gil Peyrot 2018-07-31 21:32:39 +02:00
parent 9d3028ad71
commit cd0d47b92e

View file

@ -155,6 +155,20 @@ generate_element!(
] ]
); );
impl Item {
pub fn new(affiliation: Affiliation, role: Role) -> Item {
Item {
affiliation,
role,
jid: None,
nick: None,
actor: None,
continue_: None,
reason: None,
}
}
}
generate_element!( generate_element!(
MucUser, "x", MUC_USER, children: [ MucUser, "x", MUC_USER, children: [
status: Vec<Status> = ("status", MUC_USER) => Status, status: Vec<Status> = ("status", MUC_USER) => Status,