From 4bd4eec740e82be081ac3e7456e728688e77a17f Mon Sep 17 00:00:00 2001 From: "Mark @ Germ" Date: Wed, 26 Feb 2025 22:10:31 -0800 Subject: [PATCH] add public is_welcome --- mls-rs/src/client.rs | 4 +--- mls-rs/src/group/framing.rs | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mls-rs/src/client.rs b/mls-rs/src/client.rs index c5f9e19a..94f2713a 100644 --- a/mls-rs/src/client.rs +++ b/mls-rs/src/client.rs @@ -2,11 +2,11 @@ // Copyright by contributors to this project. // SPDX-License-Identifier: (Apache-2.0 OR MIT) -use crate::group::snapshot::legacy::LegacySnapshot; use crate::cipher_suite::CipherSuite; use crate::client_builder::{recreate_config, BaseConfig, ClientBuilder, MakeConfig}; use crate::client_config::ClientConfig; use crate::group::framing::MlsMessage; +use crate::group::snapshot::legacy::LegacySnapshot; use crate::group::{cipher_suite_provider, validate_group_info_joiner, GroupInfo}; use crate::group::{ @@ -688,8 +688,6 @@ where Group::from_snapshot(self.config.clone(), legacy.into()).await } } - - } /// Load an existing group state into this client using the diff --git a/mls-rs/src/group/framing.rs b/mls-rs/src/group/framing.rs index 3df6195c..23f3dc20 100644 --- a/mls-rs/src/group/framing.rs +++ b/mls-rs/src/group/framing.rs @@ -386,6 +386,13 @@ impl MlsMessage { } } + pub fn is_welcome(&self) -> bool { + match self.payload { + MlsMessagePayload::Welcome(_) => true, + _ => false, + } + } + #[inline(always)] pub fn into_group_info(self) -> Option { match self.payload {