Procházet zdrojové kódy

fix creation of verified groups

cyberta před 5 roky
rodič
revize
6964794fa3

+ 2 - 2
deltachat-ios/Controller/NewGroupController.swift

@@ -66,7 +66,7 @@ class NewGroupController: UITableViewController, MediaPickerDelegate {
 
     @objc func doneButtonPressed() {
         if groupChatId == 0 {
-            groupChatId = dcContext.createGroupChat(name: groupName)
+            groupChatId = dcContext.createGroupChat(verified: isVerifiedGroup, name: groupName)
         } else {
             _ = dcContext.setChatName(chatId: groupChatId, name: groupName)
         }
@@ -190,7 +190,7 @@ class NewGroupController: UITableViewController, MediaPickerDelegate {
                 contactsWithoutSelf.remove(Int(DC_CONTACT_ID_SELF))
                 coordinator?.showAddMembers(preselectedMembers: contactsWithoutSelf, isVerified: self.isVerifiedGroup)
             } else {
-                self.groupChatId = dcContext.createGroupChat(name: groupName)
+                self.groupChatId = dcContext.createGroupChat(verified: isVerifiedGroup, name: groupName)
                 coordinator?.showQrCodeInvite(chatId: Int(self.groupChatId))
             }
         }

+ 2 - 2
deltachat-ios/DC/Wrapper.swift

@@ -42,8 +42,8 @@ class DcContext {
         return Int(dc_create_chat_by_contact_id(contextPointer, UInt32(contactId)))
     }
 
-    func createGroupChat(name: String) -> Int {
-         return Int(dc_create_group_chat(contextPointer, 0, name))
+    func createGroupChat(verified: Bool, name: String) -> Int {
+        return Int(dc_create_group_chat(contextPointer, verified ? 1 : 0, name))
     }
 
     func addContactToChat(chatId: Int, contactId: Int) -> Bool {