Skip to content

Commit d2af0fc

Browse files
erskingardneryukibtc
authored andcommitted
mls-storage: add GroupState::Pending variant
Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 9480701 commit d2af0fc

File tree

1 file changed

+5
-1
lines changed
  • crates/nostr-mls-storage/src/groups

1 file changed

+5
-1
lines changed

crates/nostr-mls-storage/src/groups/types.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ impl<'de> Deserialize<'de> for GroupType {
7373
pub enum GroupState {
7474
/// The group is active
7575
Active,
76-
/// The group is inactive
76+
/// The group is inactive, this is used for groups that users have left or for welcome messages that have been declined
7777
Inactive,
78+
/// The group is pending, this is used for groups that users are invited to but haven't joined yet
79+
Pending,
7880
}
7981

8082
impl fmt::Display for GroupState {
@@ -89,6 +91,7 @@ impl GroupState {
8991
match self {
9092
Self::Active => "active",
9193
Self::Inactive => "inactive",
94+
Self::Pending => "pending",
9295
}
9396
}
9497
}
@@ -100,6 +103,7 @@ impl FromStr for GroupState {
100103
match s {
101104
"active" => Ok(Self::Active),
102105
"inactive" => Ok(Self::Inactive),
106+
"pending" => Ok(Self::Pending),
103107
_ => Err(GroupError::InvalidParameters(format!(
104108
"Invalid group state: {}",
105109
s

0 commit comments

Comments
 (0)