@@ -945,7 +945,7 @@ impl CommandApi {
945
945
Ok ( contacts. iter ( ) . map ( |id| id. to_u32 ( ) ) . collect :: < Vec < u32 > > ( ) )
946
946
}
947
947
948
- /// Create a new group chat.
948
+ /// Create a new encrypted group chat (with PGP contacts) .
949
949
///
950
950
/// After creation,
951
951
/// the group has one member with the ID DC_CONTACT_ID_SELF
@@ -963,14 +963,24 @@ impl CommandApi {
963
963
///
964
964
/// @param protect If set to 1 the function creates group with protection initially enabled.
965
965
/// Only verified members are allowed in these groups
966
- /// and end-to-end-encryption is always enabled.
967
966
async fn create_group_chat ( & self , account_id : u32 , name : String , protect : bool ) -> Result < u32 > {
968
967
let ctx = self . get_context ( account_id) . await ?;
969
968
let protect = match protect {
970
969
true => ProtectionStatus :: Protected ,
971
970
false => ProtectionStatus :: Unprotected ,
972
971
} ;
973
- chat:: create_group_chat ( & ctx, protect, & name)
972
+ chat:: create_group_ex ( & ctx, Some ( protect) , & name)
973
+ . await
974
+ . map ( |id| id. to_u32 ( ) )
975
+ }
976
+
977
+ /// Create a new unencrypted group chat.
978
+ ///
979
+ /// Same as [`Self::create_group_chat`], but the chat is unencrypted and can only have address
980
+ /// contacts.
981
+ async fn create_group_chat_unencrypted ( & self , account_id : u32 , name : String ) -> Result < u32 > {
982
+ let ctx = self . get_context ( account_id) . await ?;
983
+ chat:: create_group_ex ( & ctx, None , & name)
974
984
. await
975
985
. map ( |id| id. to_u32 ( ) )
976
986
}
0 commit comments