Skip to content

Commit

Permalink
Add default group name to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Apr 15, 2024
1 parent b938d06 commit 11d8841
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions xmtp_mls/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ pub const MAX_GROUP_SIZE: u8 = 250;
/// | 0x0005 | external_senders | GC | Y | RFC XXXX |
/// | 0xff00 - 0xffff | Reserved for Private Use | N/A | N/A | RFC XXXX |
pub const MUTABLE_METADATA_EXTENSION_ID: u16 = 0xff00;

pub const DEFAULT_GROUP_NAME: &str = "New Group";
7 changes: 4 additions & 3 deletions xmtp_mls/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ use self::{

use crate::{
client::{deserialize_welcome, ClientError, MessageProcessingError},
configuration::{CIPHERSUITE, MAX_GROUP_SIZE, MUTABLE_METADATA_EXTENSION_ID},
configuration::{
CIPHERSUITE, DEFAULT_GROUP_NAME, MAX_GROUP_SIZE, MUTABLE_METADATA_EXTENSION_ID,
},
hpke::{decrypt_welcome, HpkeError},
identity::{Identity, IdentityError},
retry::RetryableError,
Expand Down Expand Up @@ -207,8 +209,7 @@ where
&client.identity,
permissions.unwrap_or_default().to_policy_set(),
)?;
// TODO: Add constant for default group name
let mutable_metadata = build_mutable_metadata_extension("New Group".to_string())?;
let mutable_metadata = build_mutable_metadata_extension(DEFAULT_GROUP_NAME.to_string())?;
let group_config = build_group_config(protected_metadata, mutable_metadata)?;

let mut mls_group = OpenMlsGroup::new(
Expand Down

0 comments on commit 11d8841

Please sign in to comment.