@@ -953,7 +953,7 @@ impl CommandApi {
953
953
Ok ( contacts. iter ( ) . map ( |id| id. to_u32 ( ) ) . collect :: < Vec < u32 > > ( ) )
954
954
}
955
955
956
- /// Create a new group chat.
956
+ /// Create a new encrypted group chat (with key-contacts) .
957
957
///
958
958
/// After creation,
959
959
/// the group has one member with the ID DC_CONTACT_ID_SELF
@@ -971,14 +971,24 @@ impl CommandApi {
971
971
///
972
972
/// @param protect If set to 1 the function creates group with protection initially enabled.
973
973
/// Only verified members are allowed in these groups
974
- /// and end-to-end-encryption is always enabled.
975
974
async fn create_group_chat ( & self , account_id : u32 , name : String , protect : bool ) -> Result < u32 > {
976
975
let ctx = self . get_context ( account_id) . await ?;
977
976
let protect = match protect {
978
977
true => ProtectionStatus :: Protected ,
979
978
false => ProtectionStatus :: Unprotected ,
980
979
} ;
981
- chat:: create_group_chat ( & ctx, protect, & name)
980
+ chat:: create_group_ex ( & ctx, Some ( protect) , & name)
981
+ . await
982
+ . map ( |id| id. to_u32 ( ) )
983
+ }
984
+
985
+ /// Create a new unencrypted group chat.
986
+ ///
987
+ /// Same as [`Self::create_group_chat`], but the chat is unencrypted and can only have
988
+ /// address-contacts.
989
+ async fn create_group_chat_unencrypted ( & self , account_id : u32 , name : String ) -> Result < u32 > {
990
+ let ctx = self . get_context ( account_id) . await ?;
991
+ chat:: create_group_ex ( & ctx, None , & name)
982
992
. await
983
993
. map ( |id| id. to_u32 ( ) )
984
994
}
0 commit comments