From cd0d47b92e9651bbf46fd85c983b1418d6c2c31b Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 31 Jul 2018 21:32:39 +0200 Subject: [PATCH] muc/user: Add a constructor for Item. --- src/muc/user.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/muc/user.rs b/src/muc/user.rs index 8baa6271..bffcbcd9 100644 --- a/src/muc/user.rs +++ b/src/muc/user.rs @@ -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!( MucUser, "x", MUC_USER, children: [ status: Vec = ("status", MUC_USER) => Status,