diff --git a/Monal/Classes/ContactDetails.swift b/Monal/Classes/ContactDetails.swift index 407021037..3c21c3510 100644 --- a/Monal/Classes/ContactDetails.swift +++ b/Monal/Classes/ContactDetails.swift @@ -369,7 +369,7 @@ struct ContactDetails: View { #if !DISABLE_OMEMO if !HelperTools.isContactBlacklisted(forEncryption:contact.obj) && !contact.isSelfChat { if !contact.isGroup || contact.mucType == "group" { - NavigationLink(destination: LazyClosureView(OmemoKeys(contact: contact))) { + NavigationLink(destination: LazyClosureView(OmemoKeysView(contact: contact))) { Text("Encryption Keys") } } diff --git a/Monal/Classes/OmemoKeys.swift b/Monal/Classes/OmemoKeysView.swift similarity index 96% rename from Monal/Classes/OmemoKeys.swift rename to Monal/Classes/OmemoKeysView.swift index b2e049088..c777b4dc3 100644 --- a/Monal/Classes/OmemoKeys.swift +++ b/Monal/Classes/OmemoKeysView.swift @@ -8,7 +8,7 @@ import OrderedCollections -struct OmemoKeysEntry: View { +struct OmemoKeysEntryView: View { private let contactJid: String @State private var trustLevel: NSNumber @@ -195,7 +195,7 @@ struct OmemoKeysEntry: View { } } -struct OmemoKeysForContact: View { +struct OmemoKeysForContactView: View { @State private var deviceIds: OrderedSet @State private var showDeleteKeyAlert = false @State private var selectedDeviceForDeletion : NSNumber @@ -212,7 +212,7 @@ struct OmemoKeysForContact: View { self.ownKeys = (account.connectionProperties.identity.jid == contact.obj.contactJid) self.contactJid = contact.obj.contactJid self.account = account - self.deviceIds = OmemoKeysForContact.knownDevices(account: self.account, jid: self.contactJid) + self.deviceIds = OmemoKeysForContactView.knownDevices(account: self.account, jid: self.contactJid) self.selectedDeviceForDeletion = -1 } @@ -221,7 +221,7 @@ struct OmemoKeysForContact: View { } private func refreshKnownDevices() -> Void { - self.deviceIds = OmemoKeysForContact.knownDevices(account: self.account, jid: self.contactJid) + self.deviceIds = OmemoKeysForContactView.knownDevices(account: self.account, jid: self.contactJid) } func deleteButton(deviceId: NSNumber) -> some View { @@ -252,7 +252,7 @@ struct OmemoKeysForContact: View { ForEach(self.deviceIds, id: \.self) { deviceId in HStack { ZStack(alignment: .topLeading) { - OmemoKeysEntry(account: self.account, contactJid: self.contactJid, deviceId: deviceId, isOwnDevice: (ownKeys && deviceId == self.deviceId)) + OmemoKeysEntryView(account: self.account, contactJid: self.contactJid, deviceId: deviceId, isOwnDevice: (ownKeys && deviceId == self.deviceId)) if(ownKeys == true) { if(deviceId != self.deviceId) { deleteButton(deviceId: deviceId) @@ -271,7 +271,7 @@ struct OmemoKeysForContact: View { } } -struct OmemoKeysForChat: View { +struct OmemoKeysForChatView: View { private var viewContact: ObservableKVOWrapper? // store initial contact with which the view was initialized for refreshs... private var account: xmpp? @@ -353,12 +353,12 @@ struct OmemoKeysForChat: View { Section(header:helpDescription) { if (self.contacts.count == 1) { ForEach(self.contacts, id: \.self.obj) { contact in - OmemoKeysForContact(contact: contact, account: self.account!) + OmemoKeysForContactView(contact: contact, account: self.account!) } } else { ForEach(self.contacts, id: \.self.obj) { contact in DisclosureGroup(content: { - OmemoKeysForContact(contact: contact, account: self.account!) + OmemoKeysForContactView(contact: contact, account: self.account!) }, label: { HStack { Text("Keys of \(contact.obj.contactJid)") @@ -416,7 +416,7 @@ struct OmemoKeysForChat: View { } } -struct OmemoKeys: View { +struct OmemoKeysView: View { private var viewContact: ObservableKVOWrapper? private var account: xmpp? @State private var contacts: OrderedSet> @@ -429,7 +429,7 @@ struct OmemoKeys: View { var body: some View { if self.account != nil && !self.contacts.isEmpty { - OmemoKeysForChat(contact: viewContact) + OmemoKeysForChatView(contact: viewContact) } else if self.contacts.isEmpty { ContentUnavailableShimView("No Contacts", systemImage: "person.2.slash", description: Text("Cannot display keys as there are no contacts to display keys for.")) } else if self.account == nil { @@ -441,6 +441,6 @@ struct OmemoKeys: View { struct OmemoKeys_Previews: PreviewProvider { static var previews: some View { // TODO some dummy views, requires a dummy xmpp obj - OmemoKeys(contact:nil); + OmemoKeysView(contact:nil); } } diff --git a/Monal/Classes/SwiftuiHelpers.swift b/Monal/Classes/SwiftuiHelpers.swift index 108843b82..fb8c3e62d 100644 --- a/Monal/Classes/SwiftuiHelpers.swift +++ b/Monal/Classes/SwiftuiHelpers.swift @@ -655,9 +655,9 @@ class SwiftuiInterface : NSObject { func makeOwnOmemoKeyView(_ ownContact: MLContact?) -> UIViewController { let host = UIHostingController(rootView:AnyView(EmptyView())) if(ownContact == nil) { - host.rootView = AnyView(OmemoKeys(contact: nil)) + host.rootView = AnyView(OmemoKeysView(contact: nil)) } else { - host.rootView = AnyView(OmemoKeys(contact: ObservableKVOWrapper(ownContact!))) + host.rootView = AnyView(OmemoKeysView(contact: ObservableKVOWrapper(ownContact!))) } return host } diff --git a/Monal/Monal.xcodeproj/project.pbxproj b/Monal/Monal.xcodeproj/project.pbxproj index c14330556..abd901d01 100644 --- a/Monal/Monal.xcodeproj/project.pbxproj +++ b/Monal/Monal.xcodeproj/project.pbxproj @@ -92,7 +92,7 @@ 3D65B791272350F0005A30F4 /* SwiftuiHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D65B790272350F0005A30F4 /* SwiftuiHelpers.swift */; }; 3D7D352328626CB80042C5E5 /* LoadingOverlay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D7D352228626CB80042C5E5 /* LoadingOverlay.swift */; }; 3D85E587282AE523006F5B3A /* OmemoQrCodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D85E586282AE523006F5B3A /* OmemoQrCodeView.swift */; }; - 3DC5035C2822F5220064C8A7 /* OmemoKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DC5035B2822F5220064C8A7 /* OmemoKeys.swift */; }; + 3DC5035C2822F5220064C8A7 /* OmemoKeysView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DC5035B2822F5220064C8A7 /* OmemoKeysView.swift */; }; 43A92B80C8CD5E04074B5A3E /* Pods_MonalXMPPUnitTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C59BAF969550DFAC27E5F2B /* Pods_MonalXMPPUnitTests.framework */; }; 540A3FAD24D674BD0008965D /* MLSQLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 540A3FAC24D674BD0008965D /* MLSQLite.m */; }; 540BD0D224D8D1F40087A743 /* IPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 540BD0D124D8D1F20087A743 /* IPC.h */; }; @@ -518,7 +518,7 @@ 3D7D352228626CB80042C5E5 /* LoadingOverlay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingOverlay.swift; sourceTree = ""; }; 3D85E586282AE523006F5B3A /* OmemoQrCodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OmemoQrCodeView.swift; sourceTree = ""; }; 3D88BB76295BB6DC00FB30BA /* CreateGroupMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateGroupMenu.swift; sourceTree = ""; }; - 3DC5035B2822F5220064C8A7 /* OmemoKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OmemoKeys.swift; sourceTree = ""; }; + 3DC5035B2822F5220064C8A7 /* OmemoKeysView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OmemoKeysView.swift; sourceTree = ""; }; 3EB7A7084FA9A8F68A3D251C /* Pods-MonalXMPPUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MonalXMPPUnitTests.debug.xcconfig"; path = "Target Support Files/Pods-MonalXMPPUnitTests/Pods-MonalXMPPUnitTests.debug.xcconfig"; sourceTree = ""; }; 4049F81F60EA5B7A57A4E9C6 /* Pods-NotificationService.beta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.beta.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.beta.xcconfig"; sourceTree = ""; }; 43FFAD161EF5A0B1CB149814 /* Pods-shareSheet.alpha-ios.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-shareSheet.alpha-ios.xcconfig"; path = "Target Support Files/Pods-shareSheet/Pods-shareSheet.alpha-ios.xcconfig"; sourceTree = ""; }; @@ -1112,7 +1112,7 @@ children = ( C1F5C7AB2777621B0001F295 /* ContactResources.swift */, 3D85E586282AE523006F5B3A /* OmemoQrCodeView.swift */, - 3DC5035B2822F5220064C8A7 /* OmemoKeys.swift */, + 3DC5035B2822F5220064C8A7 /* OmemoKeysView.swift */, 3D65B78C27234B74005A30F4 /* ContactDetails.swift */, 3D5A91412842B4AE008CE57E /* MemberList.swift */, C18967C62B81F61B0073C7C5 /* ChannelMemberList.swift */, @@ -2098,7 +2098,7 @@ 84FC375928981A5600634E3E /* PasswordMigration.swift in Sources */, E89DD32625C6626400925F62 /* MLFileTransferVideoCell.m in Sources */, 26E3ED871FEC0CB7008ABDA5 /* MLServerDetails.m in Sources */, - 3DC5035C2822F5220064C8A7 /* OmemoKeys.swift in Sources */, + 3DC5035C2822F5220064C8A7 /* OmemoKeysView.swift in Sources */, 262797AF178A577300B85D94 /* MLContactCell.m in Sources */, 2696EED21791245A00BC54B8 /* chatViewController.m in Sources */, C12436142434AB5D00B8F074 /* MLAttributedLabel.m in Sources */,