Răsfoiți Sursa

adapt to new protect-api

B. Petersen 4 ani în urmă
părinte
comite
91e7eec98f

+ 3 - 4
DcCore/DcCore/DC/Wrapper.swift

@@ -700,8 +700,7 @@ public class DcChat {
     }
 
     public var isGroup: Bool {
-        let type = Int(dc_chat_get_type(chatPointer))
-        return type == DC_CHAT_TYPE_GROUP || type == DC_CHAT_TYPE_VERIFIED_GROUP
+        return Int(dc_chat_get_type(chatPointer)) == DC_CHAT_TYPE_GROUP
     }
 
     public var isSelfTalk: Bool {
@@ -716,8 +715,8 @@ public class DcChat {
         return Int(dc_chat_can_send(chatPointer)) != 0
     }
 
-    public var isVerified: Bool {
-        return dc_chat_is_verified(chatPointer) > 0
+    public var isProtected: Bool {
+        return dc_chat_is_protected(chatPointer) != 0
     }
 
     public var isMuted: Bool {

+ 1 - 1
deltachat-ios/Chat/ChatViewControllerNew.swift

@@ -75,7 +75,7 @@ class ChatViewControllerNew: UITableViewController {
             )
             badge.setLabelFont(UIFont.systemFont(ofSize: 14))
         }
-        badge.setVerified(chat.isVerified)
+        badge.setVerified(chat.isProtected)
         badge.accessibilityTraits = .button
         return UIBarButtonItem(customView: badge)
     }()

+ 1 - 1
deltachat-ios/Controller/AddGroupMembersViewController.swift

@@ -70,7 +70,7 @@ class AddGroupMembersViewController: GroupMembersViewController {
     init(chatId: Int) {
         self.chatId = chatId
         super.init()
-        isVerifiedGroup = chat?.isVerified ?? false
+        isVerifiedGroup = chat?.isProtected ?? false
         numberOfSections = sections.count
         selectedContactIds = Set(dcContext.getChat(chatId: chatId).contactIds)
     }

+ 1 - 1
deltachat-ios/Controller/ChatViewController.swift

@@ -91,7 +91,7 @@ class ChatViewController: MessagesViewController {
             )
             badge.setLabelFont(UIFont.systemFont(ofSize: 14))
         }
-        badge.setVerified(chat.isVerified)
+        badge.setVerified(chat.isProtected)
         badge.accessibilityTraits = .button
         return UIBarButtonItem(customView: badge)
     }()

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

@@ -106,7 +106,7 @@ class GroupChatDetailViewController: UIViewController {
             header.setBackupImage(name: chat.name, color: chat.color)
         }
         header.onAvatarTap = showGroupAvatarIfNeeded
-        header.setVerified(isVerified: chat.isVerified)
+        header.setVerified(isVerified: chat.isProtected)
         return header
     }()
 
@@ -227,7 +227,7 @@ class GroupChatDetailViewController: UIViewController {
         } else {
             groupHeader.setBackupImage(name: chat.name, color: chat.color)
         }
-        groupHeader.setVerified(isVerified: chat.isVerified)
+        groupHeader.setVerified(isVerified: chat.isProtected)
     }
 
     private func updateCellValues() {

+ 1 - 1
deltachat-ios/View/ContactCell.swift

@@ -327,7 +327,7 @@ class ContactCell: UITableViewCell {
             } else {
                 setBackupImage(name: chat.name, color: chat.color)
             }
-            setVerified(isVerified: chat.isVerified)
+            setVerified(isVerified: chat.isProtected)
             setTimeLabel(chatData.summary.timestamp)
             setStatusIndicators(unreadCount: chatData.unreadMessages,
                                 status: chatData.summary.state,