diff --git a/deltachat-jsonrpc/src/api.rs b/deltachat-jsonrpc/src/api.rs index 0b6eda8f8..8619e3c47 100644 --- a/deltachat-jsonrpc/src/api.rs +++ b/deltachat-jsonrpc/src/api.rs @@ -953,7 +953,7 @@ impl CommandApi { Ok(contacts.iter().map(|id| id.to_u32()).collect::>()) } - /// Create a new group chat. + /// Create a new encrypted group chat (with key-contacts). /// /// After creation, /// the group has one member with the ID DC_CONTACT_ID_SELF @@ -971,14 +971,24 @@ impl CommandApi { /// /// @param protect If set to 1 the function creates group with protection initially enabled. /// Only verified members are allowed in these groups - /// and end-to-end-encryption is always enabled. async fn create_group_chat(&self, account_id: u32, name: String, protect: bool) -> Result { let ctx = self.get_context(account_id).await?; let protect = match protect { true => ProtectionStatus::Protected, false => ProtectionStatus::Unprotected, }; - chat::create_group_chat(&ctx, protect, &name) + chat::create_group_ex(&ctx, Some(protect), &name) + .await + .map(|id| id.to_u32()) + } + + /// Create a new unencrypted group chat. + /// + /// Same as [`Self::create_group_chat`], but the chat is unencrypted and can only have + /// address-contacts. + async fn create_group_chat_unencrypted(&self, account_id: u32, name: String) -> Result { + let ctx = self.get_context(account_id).await?; + chat::create_group_ex(&ctx, None, &name) .await .map(|id| id.to_u32()) }