From b8ba74e336fb9b12eadc44edf86a787fcbe3b8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 7 Jun 2023 18:40:08 +0200 Subject: [PATCH] parser: Add helpers on MucUser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- parsers/src/muc/user.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/parsers/src/muc/user.rs b/parsers/src/muc/user.rs index e355c3d..a4613f8 100644 --- a/parsers/src/muc/user.rs +++ b/parsers/src/muc/user.rs @@ -271,6 +271,25 @@ generate_element!( ] ); +impl MucUser { + pub fn new() -> MucUser { + MucUser { + status: vec![], + items: vec![], + } + } + + pub fn with_status(mut self, status: Vec) -> MucUser { + self.status = status; + self + } + + pub fn with_items(mut self, items: Vec) -> MucUser { + self.items = items; + self + } +} + impl MessagePayload for MucUser {} impl PresencePayload for MucUser {}