From 51226f635d991630776d49918a6cca7031bcce27 Mon Sep 17 00:00:00 2001 From: Andreas Buff Date: Fri, 9 Jul 2021 15:06:05 +0200 Subject: [PATCH] IOSAD-213 Uses new PEPObjCTypeUtils --- .../project.pbxproj | 33 +++ pEpObjCAdapter.xcodeproj/project.pbxproj | 123 ++++++---- pEpObjCAdapter/Extensions/NSArray+Engine.h | 36 --- pEpObjCAdapter/Extensions/NSArray+Engine.m | 166 -------------- .../Extensions/PEPIdentity+Engine.h | 27 --- .../Extensions/PEPIdentity+Engine.m | 81 ------- pEpObjCAdapter/Extensions/PEPMessage+Engine.h | 30 --- pEpObjCAdapter/Extensions/PEPMessage+Engine.m | 217 ------------------ pEpObjCAdapter/PEPInternalSession.m | 6 +- 9 files changed, 117 insertions(+), 602 deletions(-) delete mode 100644 pEpObjCAdapter/Extensions/NSArray+Engine.h delete mode 100644 pEpObjCAdapter/Extensions/NSArray+Engine.m delete mode 100644 pEpObjCAdapter/Extensions/PEPIdentity+Engine.h delete mode 100644 pEpObjCAdapter/Extensions/PEPIdentity+Engine.m delete mode 100644 pEpObjCAdapter/Extensions/PEPMessage+Engine.h delete mode 100644 pEpObjCAdapter/Extensions/PEPMessage+Engine.m diff --git a/Subprojects/PEPObjCAdapterTypes/PEPObjCAdapterTypes.xcodeproj/project.pbxproj b/Subprojects/PEPObjCAdapterTypes/PEPObjCAdapterTypes.xcodeproj/project.pbxproj index 2eb56dc..dcabcb5 100644 --- a/Subprojects/PEPObjCAdapterTypes/PEPObjCAdapterTypes.xcodeproj/project.pbxproj +++ b/Subprojects/PEPObjCAdapterTypes/PEPObjCAdapterTypes.xcodeproj/project.pbxproj @@ -64,6 +64,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 1585EB13269861CE00B822E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1585EB0D269861CE00B822E1 /* PEPObjCTypeUtils.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1585EA7C26984C4300B822E1; + remoteInfo = PEPObjCTypeUtils_macOS; + }; 4E5758D726836A0C0084F02D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 4E575836268328CD0084F02D /* Project object */; @@ -99,6 +106,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 1585EB0D269861CE00B822E1 /* PEPObjCTypeUtils.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PEPObjCTypeUtils.xcodeproj; path = ../../../PEPObjCTypeUtils/PEPObjCTypeUtils.xcodeproj; sourceTree = ""; }; 43D44C832685BE4300638D1C /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; 4E575841268328CD0084F02D /* PEPObjCAdapterTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPObjCAdapterTypes.h; sourceTree = ""; }; 4E575843268328CD0084F02D /* PEPObjCAdapterTypes.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPObjCAdapterTypes.m; sourceTree = ""; }; @@ -166,9 +174,18 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 1585EB0E269861CE00B822E1 /* Products */ = { + isa = PBXGroup; + children = ( + 1585EB14269861CE00B822E1 /* libPEPObjCTypeUtils_macOS.a */, + ); + name = Products; + sourceTree = ""; + }; 4E575835268328CD0084F02D = { isa = PBXGroup; children = ( + 1585EB0D269861CE00B822E1 /* PEPObjCTypeUtils.xcodeproj */, 4E575840268328CD0084F02D /* PEPObjCAdapterTypes */, 4E575859268329170084F02D /* PEPObjCAdapterTypes_macOS */, 4E575866268329A20084F02D /* PEPObjCAdapterTypes_iOS */, @@ -429,6 +446,12 @@ mainGroup = 4E575835268328CD0084F02D; productRefGroup = 4E57583F268328CD0084F02D /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 1585EB0E269861CE00B822E1 /* Products */; + ProjectRef = 1585EB0D269861CE00B822E1 /* PEPObjCTypeUtils.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 4E575857268329170084F02D /* PEPObjCAdapterTypes_macOS */, @@ -438,6 +461,16 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + 1585EB14269861CE00B822E1 /* libPEPObjCTypeUtils_macOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libPEPObjCTypeUtils_macOS.a; + remoteRef = 1585EB13269861CE00B822E1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ 4E5758BD26833D140084F02D /* Resources */ = { isa = PBXResourcesBuildPhase; diff --git a/pEpObjCAdapter.xcodeproj/project.pbxproj b/pEpObjCAdapter.xcodeproj/project.pbxproj index af24d2e..cb3f4a3 100644 --- a/pEpObjCAdapter.xcodeproj/project.pbxproj +++ b/pEpObjCAdapter.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ 1500C92E264BD9BD001FD417 /* libPEPToolbox_macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1500C92D264BD9BD001FD417 /* libPEPToolbox_macOS.a */; }; 15160690257A3E1900DD42E0 /* module.modulemap in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1543DD8B257A3C9E0041EFB5 /* module.modulemap */; platformFilter = ios; }; 15160AF1257A58A000DD42E0 /* libpEpEngine.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64289E561B8B70E800FC617B /* libpEpEngine.a */; platformFilter = ios; }; - 15160D2D257A920F00DD42E0 /* libPEPObjCAdapter_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1543DC66257943CE0041EFB5 /* libPEPObjCAdapter_iOS.a */; platformFilter = ios; }; 15160E80257AA06500DD42E0 /* pEp4iosIntern.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15160E7F257AA06500DD42E0 /* pEp4iosIntern.framework */; platformFilter = ios; }; 152A9C472010F50400F962ED /* PEPInternalSessionTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 152A9C462010F50400F962ED /* PEPInternalSessionTest.m */; }; 1543D9E02577EF260041EFB5 /* libpEpEngine_macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1552DCBD2577E0B600A92F71 /* libpEpEngine_macOS.a */; }; @@ -66,11 +65,8 @@ 1552D963257660C900A92F71 /* NSString+NormalizePassphrase.h in Headers */ = {isa = PBXBuildFile; fileRef = 4349CD6D24AC73FC00A22A13 /* NSString+NormalizePassphrase.h */; }; 1552D964257660C900A92F71 /* PEPQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B311ECC2ACD007E7E2E /* PEPQueue.h */; }; 1552D965257660C900A92F71 /* NSArray+Take.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B271ECC2ACD007E7E2E /* NSArray+Take.m */; }; - 1552D966257660C900A92F71 /* NSArray+Engine.m in Sources */ = {isa = PBXBuildFile; fileRef = 438C0ECB254020F000337922 /* NSArray+Engine.m */; }; - 1552D967257660C900A92F71 /* PEPIdentity+Engine.m in Sources */ = {isa = PBXBuildFile; fileRef = 438C0F1225402D6400337922 /* PEPIdentity+Engine.m */; }; 1552D968257660C900A92F71 /* PEPInternalSession+PassphraseCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 433DFBB524A61D4B00AB373B /* PEPInternalSession+PassphraseCache.h */; }; 1552D969257660C900A92F71 /* NSError+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DED785203C25E200D45CD6 /* NSError+PEP.m */; }; - 1552D96A257660C900A92F71 /* PEPIdentity+Engine.h in Headers */ = {isa = PBXBuildFile; fileRef = 438C0F1125402D6400337922 /* PEPIdentity+Engine.h */; }; 1552D96B257660C900A92F71 /* PEPPassphraseCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 43589EF524A4A3B70079BEA2 /* PEPPassphraseCache.h */; }; 1552D96C257660C900A92F71 /* PEPSync.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F73BE92166248E00AB4524 /* PEPSync.m */; }; 1552D96D257660C900A92F71 /* PEPQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B321ECC2ACD007E7E2E /* PEPQueue.m */; }; @@ -95,26 +91,23 @@ 1552D980257660C900A92F71 /* PEPObjCAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B301ECC2ACD007E7E2E /* PEPObjCAdapter.m */; }; 1552D981257660C900A92F71 /* PEPInternalSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B341ECC2ACD007E7E2E /* PEPInternalSession.h */; }; 1552D982257660C900A92F71 /* PEPPassphraseUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 436C9A3124DC48B600007A3D /* PEPPassphraseUtil.h */; }; - 1552D983257660C900A92F71 /* PEPMessage+Engine.m in Sources */ = {isa = PBXBuildFile; fileRef = 43ECE9C725407FF2005F1925 /* PEPMessage+Engine.m */; }; 1552D984257660C900A92F71 /* PEPInternalSession+PassphraseCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 433DFBB624A61D4B00AB373B /* PEPInternalSession+PassphraseCache.m */; }; 1552D985257660C900A92F71 /* NSNumber+PEPRating+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4360A9FE2227EBB200E62E5A /* NSNumber+PEPRating+Internal.h */; }; 1552D986257660C900A92F71 /* PEPPassphraseUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 436C9A3224DC48B600007A3D /* PEPPassphraseUtil.m */; }; - 1552D987257660C900A92F71 /* NSArray+Engine.h in Headers */ = {isa = PBXBuildFile; fileRef = 438C0ECA254020A400337922 /* NSArray+Engine.h */; }; 1552D988257660C900A92F71 /* NSArray+Take.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B261ECC2ACD007E7E2E /* NSArray+Take.h */; }; 1552D989257660C900A92F71 /* PEPObjCAdapter+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B2E1ECC2ACD007E7E2E /* PEPObjCAdapter+Internal.h */; }; 1552D98A257660C900A92F71 /* NSError+PEP.h in Headers */ = {isa = PBXBuildFile; fileRef = 43DED784203C25E200D45CD6 /* NSError+PEP.h */; }; 1552D98B257660C900A92F71 /* NSError+PEP+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */; }; 1552D98C257660C900A92F71 /* PEPSync_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 430CD9BF2292B1EA00AAC37F /* PEPSync_Internal.h */; }; 1552D98D257660C900A92F71 /* PEPPassphraseCacheEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = 433DFBAB24A5E04000AB373B /* PEPPassphraseCacheEntry.m */; }; - 1552D98E257660C900A92F71 /* PEPMessage+Engine.h in Headers */ = {isa = PBXBuildFile; fileRef = 43ECE9C825407FF3005F1925 /* PEPMessage+Engine.h */; }; 1552D98F257660C900A92F71 /* PEPAutoPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 434ED6D4207E27B8000A7590 /* PEPAutoPointer.h */; }; 1552D990257660C900A92F71 /* PEPPassphraseCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 43589EF624A4A3B70079BEA2 /* PEPPassphraseCache.m */; }; + 1585EB762698955800B822E1 /* libPEPObjCAdapter_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1543DC66257943CE0041EFB5 /* libPEPObjCAdapter_iOS.a */; platformFilter = ios; }; + 1585EB7C2698975E00B822E1 /* libPEPObjCTypeUtils_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1585EB312698625B00B822E1 /* libPEPObjCTypeUtils_iOS.a */; platformFilter = ios; }; + 1585EB7D2698978600B822E1 /* libPEPObjCTypeUtils_macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1585EB1A269861D700B822E1 /* libPEPObjCTypeUtils_macOS.a */; }; 15921D89261CB474003346B7 /* system.db in Resources */ = {isa = PBXBuildFile; fileRef = 15921D87261CB474003346B7 /* system.db */; }; - 159C009125BB13E200F13E2B /* PEPIdentity+Engine.m in Sources */ = {isa = PBXBuildFile; fileRef = 438C0F1225402D6400337922 /* PEPIdentity+Engine.m */; }; 159C009925BB13F700F13E2B /* NSArray+Take.m in Sources */ = {isa = PBXBuildFile; fileRef = 43209B271ECC2ACD007E7E2E /* NSArray+Take.m */; }; - 159C009F25BB140000F13E2B /* NSArray+Engine.m in Sources */ = {isa = PBXBuildFile; fileRef = 438C0ECB254020F000337922 /* NSArray+Engine.m */; }; 159C00A525BB140F00F13E2B /* NSNumber+PEPRating.m in Sources */ = {isa = PBXBuildFile; fileRef = 435665CB2080A6CB00EC5B10 /* NSNumber+PEPRating.m */; }; - 159C00A625BB140F00F13E2B /* PEPMessage+Engine.m in Sources */ = {isa = PBXBuildFile; fileRef = 43ECE9C725407FF2005F1925 /* PEPMessage+Engine.m */; }; 159C00A725BB140F00F13E2B /* PEPIdentity+Reset.m in Sources */ = {isa = PBXBuildFile; fileRef = 4326A0AC2553F882001E18C6 /* PEPIdentity+Reset.m */; }; 159C00A825BB140F00F13E2B /* NSError+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 43DED785203C25E200D45CD6 /* NSError+PEP.m */; }; 159C00A925BB140F00F13E2B /* NSString+NormalizePassphrase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4349CD6E24AC73FC00A22A13 /* NSString+NormalizePassphrase.m */; }; @@ -122,20 +115,17 @@ 159C00AB25BB140F00F13E2B /* PEPInternalSession+PassphraseCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 433DFBB624A61D4B00AB373B /* PEPInternalSession+PassphraseCache.m */; }; 159C00B125BB141000F13E2B /* (null) in Sources */ = {isa = PBXBuildFile; }; 15A922E425BF2D6000D33EAB /* NSArray+Take.h in Headers */ = {isa = PBXBuildFile; fileRef = 43209B261ECC2ACD007E7E2E /* NSArray+Take.h */; }; - 15A922EC25BF2D7300D33EAB /* NSArray+Engine.h in Headers */ = {isa = PBXBuildFile; fileRef = 438C0ECA254020A400337922 /* NSArray+Engine.h */; }; - 15A922F225BF2D7700D33EAB /* PEPIdentity+Engine.h in Headers */ = {isa = PBXBuildFile; fileRef = 438C0F1125402D6400337922 /* PEPIdentity+Engine.h */; }; 15A922F825BF2D8000D33EAB /* PEPInternalSession+PassphraseCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 433DFBB524A61D4B00AB373B /* PEPInternalSession+PassphraseCache.h */; }; 15A922F925BF2D8000D33EAB /* PEPIdentity+Reset.h in Headers */ = {isa = PBXBuildFile; fileRef = 4326A0AD2553F882001E18C6 /* PEPIdentity+Reset.h */; }; 15A922FA25BF2D8000D33EAB /* NSString+NormalizePassphrase.h in Headers */ = {isa = PBXBuildFile; fileRef = 4349CD6D24AC73FC00A22A13 /* NSString+NormalizePassphrase.h */; }; 15A922FB25BF2D8000D33EAB /* NSError+PEP.h in Headers */ = {isa = PBXBuildFile; fileRef = 43DED784203C25E200D45CD6 /* NSError+PEP.h */; }; 15A922FC25BF2D8000D33EAB /* NSError+PEP+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */; }; 15A922FD25BF2D8000D33EAB /* NSNumber+PEPRating+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4360A9FE2227EBB200E62E5A /* NSNumber+PEPRating+Internal.h */; }; - 15A922FE25BF2D8000D33EAB /* PEPMessage+Engine.h in Headers */ = {isa = PBXBuildFile; fileRef = 43ECE9C825407FF3005F1925 /* PEPMessage+Engine.h */; }; 15A9230425BF2D9600D33EAB /* (null) in Headers */ = {isa = PBXBuildFile; }; 15A9230525BF2D9700D33EAB /* (null) in Headers */ = {isa = PBXBuildFile; }; 15D3D761200F61BB00A0DA20 /* PEPSessionProviderTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 15D3D760200F61BB00A0DA20 /* PEPSessionProviderTest.m */; }; 43062BAD24EEC83400489258 /* PEPIdentity+isPEPUser.m in Sources */ = {isa = PBXBuildFile; fileRef = 43062BAC24EEC83400489258 /* PEPIdentity+isPEPUser.m */; }; - 430D78E02681E19000B12650 /* libPEPObjCAdapterProtocols_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 430D78DF2681E13300B12650 /* libPEPObjCAdapterProtocols_iOS.a */; }; + 430D78E02681E19000B12650 /* libPEPObjCAdapterProtocols_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 430D78DF2681E13300B12650 /* libPEPObjCAdapterProtocols_iOS.a */; platformFilter = ios; }; 432EF60C1C58B77900B6782A /* 0xB623F674.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432EF6091C58B77900B6782A /* 0xB623F674.asc */; }; 432EF60E1C58B77900B6782A /* msg_to_B623F674.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432EF60B1C58B77900B6782A /* msg_to_B623F674.asc */; }; 432FA2D21C884C5F00DDF874 /* partner1_F2D281C2789DD7F6_pub.asc in Resources */ = {isa = PBXBuildFile; fileRef = 432FA2CF1C884C5F00DDF874 /* partner1_F2D281C2789DD7F6_pub.asc */; }; @@ -151,8 +141,8 @@ 4349CD7924ADDB8800A22A13 /* PEPPassphraseCache+Reset.m in Sources */ = {isa = PBXBuildFile; fileRef = 4349CD7824ADDB8800A22A13 /* PEPPassphraseCache+Reset.m */; }; 43589EFB24A4ACFC0079BEA2 /* PEPPassphraseCacheTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 43589EFA24A4ACFC0079BEA2 /* PEPPassphraseCacheTest.m */; }; 43676B661C57EA1A00233933 /* B623F674_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43676B641C57EA1A00233933 /* B623F674_sec.asc */; }; - 436B444E26838437002624AB /* libPEPObjCAdapterTypes_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 436B444B26837F78002624AB /* libPEPObjCAdapterTypes_iOS.a */; }; - 436DDE162640210800B88D66 /* pEpIOSToolboxForExtensions.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 436DDE152640210800B88D66 /* pEpIOSToolboxForExtensions.framework */; }; + 436B444E26838437002624AB /* libPEPObjCAdapterTypes_iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 436B444B26837F78002624AB /* libPEPObjCAdapterTypes_iOS.a */; platformFilter = ios; }; + 436DDE162640210800B88D66 /* pEpIOSToolboxForExtensions.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 436DDE152640210800B88D66 /* pEpIOSToolboxForExtensions.framework */; platformFilter = ios; }; 436E917224B714A2000296FF /* Rick Deckard (43F270EC) – Secret.asc in Resources */ = {isa = PBXBuildFile; fileRef = 436E917124B714A1000296FF /* Rick Deckard (43F270EC) – Secret.asc */; }; 436E917724B71E12000296FF /* PEPPassphraseProviderMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 436E917624B71E12000296FF /* PEPPassphraseProviderMock.m */; }; 4396CEB82187196600FDD398 /* PEPInternalSessionTestNotifyHandshakeDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4396CEB62187190F00FDD398 /* PEPInternalSessionTestNotifyHandshakeDelegate.m */; }; @@ -183,6 +173,34 @@ remoteGlobalIDString = 1552DB112577D4F100A92F71; remoteInfo = pEpEngine_macOS; }; + 1585EB19269861D700B822E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1585EB15269861D700B822E1 /* PEPObjCTypeUtils.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1585EA7C26984C4300B822E1; + remoteInfo = PEPObjCTypeUtils_macOS; + }; + 1585EB2D2698625B00B822E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1585EB15269861D700B822E1 /* PEPObjCTypeUtils.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1585EA7B26984C4300B822E1; + remoteInfo = PEPObjCTypeUtils_macOS; + }; + 1585EB302698625B00B822E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1585EB15269861D700B822E1 /* PEPObjCTypeUtils.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1585EB1F2698623B00B822E1; + remoteInfo = PEPObjCTypeUtils_iOS; + }; + 1585EB322698626400B822E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1585EB15269861D700B822E1 /* PEPObjCTypeUtils.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1585EB3C2698636C00B822E1; + remoteInfo = PEPObjCTypeUtils_iOS; + }; 15A32462260E2A23009D07EB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 64DA243B1B833248000BEE80 /* pEpEngine.xcodeproj */; @@ -320,6 +338,7 @@ 1552DA2125766AC700A92F71 /* libpEpEngine.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpEpEngine.a; path = ../../src_pEp4ThunderbirdMacInstaller/pep4thunderbird_macos_installer_buildscript/local/lib/libpEpEngine.a; sourceTree = ""; }; 155674EC22B82D710097930C /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 155A03502608B7DE00FF2754 /* libPEPToolbox_macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPEPToolbox_macOS.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 1585EB15269861D700B822E1 /* PEPObjCTypeUtils.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PEPObjCTypeUtils.xcodeproj; path = ../PEPObjCTypeUtils/PEPObjCTypeUtils.xcodeproj; sourceTree = ""; }; 15921D87261CB474003346B7 /* system.db */ = {isa = PBXFileReference; lastKnownFileType = file; name = system.db; path = ../../../pEpEngine/db/system.db; sourceTree = ""; }; 15D3D760200F61BB00A0DA20 /* PEPSessionProviderTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPSessionProviderTest.m; sourceTree = ""; }; 15D3D77B2010DDC500A0DA20 /* PEPTestUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PEPTestUtils.h; sourceTree = ""; }; @@ -391,10 +410,6 @@ 436E917124B714A1000296FF /* Rick Deckard (43F270EC) – Secret.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Rick Deckard (43F270EC) – Secret.asc"; sourceTree = ""; }; 436E917524B71E12000296FF /* PEPPassphraseProviderMock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPPassphraseProviderMock.h; sourceTree = ""; }; 436E917624B71E12000296FF /* PEPPassphraseProviderMock.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPPassphraseProviderMock.m; sourceTree = ""; }; - 438C0ECA254020A400337922 /* NSArray+Engine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSArray+Engine.h"; sourceTree = ""; }; - 438C0ECB254020F000337922 /* NSArray+Engine.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Engine.m"; sourceTree = ""; }; - 438C0F1125402D6400337922 /* PEPIdentity+Engine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PEPIdentity+Engine.h"; sourceTree = ""; }; - 438C0F1225402D6400337922 /* PEPIdentity+Engine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "PEPIdentity+Engine.m"; sourceTree = ""; }; 4396CEB52187190F00FDD398 /* PEPInternalSessionTestNotifyHandshakeDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPInternalSessionTestNotifyHandshakeDelegate.h; sourceTree = ""; }; 4396CEB62187190F00FDD398 /* PEPInternalSessionTestNotifyHandshakeDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPInternalSessionTestNotifyHandshakeDelegate.m; sourceTree = ""; }; 4396CEC8218721F900FDD398 /* PEPInternalSessionTestSendMessageDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PEPInternalSessionTestSendMessageDelegate.m; sourceTree = ""; }; @@ -410,8 +425,6 @@ 43E1A7A6252B41B300307A7D /* pEpIOSToolbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = pEpIOSToolbox.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43E1A7AB252B421D00307A7D /* Logger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = ""; }; 43E3986A221D7EDD008E7983 /* libiconv.2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.2.tbd; path = usr/lib/libiconv.2.tbd; sourceTree = SDKROOT; }; - 43ECE9C725407FF2005F1925 /* PEPMessage+Engine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "PEPMessage+Engine.m"; sourceTree = ""; }; - 43ECE9C825407FF3005F1925 /* PEPMessage+Engine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PEPMessage+Engine.h"; sourceTree = ""; }; 43F73BE92166248E00AB4524 /* PEPSync.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPSync.m; sourceTree = ""; }; 4E5758F4268371440084F02D /* libPEPObjCAdapterTypes_macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPEPObjCAdapterTypes_macOS.a; sourceTree = BUILT_PRODUCTS_DIR; }; 4EEB4CC92680E56A00161040 /* PEPObjCAdapterProtocols.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PEPObjCAdapterProtocols.xcodeproj; path = Subprojects/PEPObjCAdapterProtocols/PEPObjCAdapterProtocols.xcodeproj; sourceTree = ""; }; @@ -433,6 +446,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1585EB7C2698975E00B822E1 /* libPEPObjCTypeUtils_iOS.a in Frameworks */, 436B444E26838437002624AB /* libPEPObjCAdapterTypes_iOS.a in Frameworks */, 430D78E02681E19000B12650 /* libPEPObjCAdapterProtocols_iOS.a in Frameworks */, 436DDE162640210800B88D66 /* pEpIOSToolboxForExtensions.framework in Frameworks */, @@ -445,6 +459,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1585EB7D2698978600B822E1 /* libPEPObjCTypeUtils_macOS.a in Frameworks */, 4E5758F5268371440084F02D /* libPEPObjCAdapterTypes_macOS.a in Frameworks */, 1500C92E264BD9BD001FD417 /* libPEPToolbox_macOS.a in Frameworks */, 1543D9E02577EF260041EFB5 /* libpEpEngine_macOS.a in Frameworks */, @@ -456,7 +471,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 15160D2D257A920F00DD42E0 /* libPEPObjCAdapter_iOS.a in Frameworks */, + 1585EB762698955800B822E1 /* libPEPObjCAdapter_iOS.a in Frameworks */, 64415E2F1BE9511C00F6CBB2 /* Security.framework in Frameworks */, 64415E301BE9513300F6CBB2 /* CFNetwork.framework in Frameworks */, ); @@ -500,6 +515,15 @@ path = PublicHeaders; sourceTree = ""; }; + 1585EB16269861D700B822E1 /* Products */ = { + isa = PBXGroup; + children = ( + 1585EB1A269861D700B822E1 /* libPEPObjCTypeUtils_macOS.a */, + 1585EB312698625B00B822E1 /* libPEPObjCTypeUtils_iOS.a */, + ); + name = Products; + sourceTree = ""; + }; 15D3D762200F6C6A00A0DA20 /* TestUtils */ = { isa = PBXGroup; children = ( @@ -555,6 +579,7 @@ 352988A11AEF964100FA7E2E = { isa = PBXGroup; children = ( + 1585EB15269861D700B822E1 /* PEPObjCTypeUtils.xcodeproj */, 4EEB4CC92680E56A00161040 /* PEPObjCAdapterProtocols.xcodeproj */, 436B444126837F78002624AB /* PEPObjCAdapterTypes.xcodeproj */, 64DA243B1B833248000BEE80 /* pEpEngine.xcodeproj */, @@ -652,14 +677,8 @@ children = ( 43209B261ECC2ACD007E7E2E /* NSArray+Take.h */, 43209B271ECC2ACD007E7E2E /* NSArray+Take.m */, - 438C0ECA254020A400337922 /* NSArray+Engine.h */, - 438C0ECB254020F000337922 /* NSArray+Engine.m */, - 438C0F1125402D6400337922 /* PEPIdentity+Engine.h */, - 438C0F1225402D6400337922 /* PEPIdentity+Engine.m */, 4326A0AD2553F882001E18C6 /* PEPIdentity+Reset.h */, 4326A0AC2553F882001E18C6 /* PEPIdentity+Reset.m */, - 43ECE9C825407FF3005F1925 /* PEPMessage+Engine.h */, - 43ECE9C725407FF2005F1925 /* PEPMessage+Engine.m */, 43DED784203C25E200D45CD6 /* NSError+PEP.h */, 4360A9FD2227CFA300E62E5A /* NSError+PEP+Internal.h */, 43DED785203C25E200D45CD6 /* NSError+PEP.m */, @@ -729,7 +748,6 @@ 1543DD40257A3B710041EFB5 /* NSNumber+PEPRating.h in Headers */, 1543DD46257A3B710041EFB5 /* PEPConstants.h in Headers */, 1543DD45257A3B710041EFB5 /* PEPSendMessageDelegate.h in Headers */, - 15A922F225BF2D7700D33EAB /* PEPIdentity+Engine.h in Headers */, 1543DD79257A3BCF0041EFB5 /* PEPPassphraseCache.h in Headers */, 1543DD78257A3BCF0041EFB5 /* PEPInternalConstants.h in Headers */, 15A9230525BF2D9700D33EAB /* (null) in Headers */, @@ -738,7 +756,6 @@ 15A922FD25BF2D8000D33EAB /* NSNumber+PEPRating+Internal.h in Headers */, 1543DD70257A3BAE0041EFB5 /* PEPObjCAdapter+Internal.h in Headers */, 1543DD7F257A3BCF0041EFB5 /* PEPQueue.h in Headers */, - 15A922FE25BF2D8000D33EAB /* PEPMessage+Engine.h in Headers */, 1543DD77257A3BCF0041EFB5 /* PEPCopyableThread.h in Headers */, 15A922F825BF2D8000D33EAB /* PEPInternalSession+PassphraseCache.h in Headers */, 15A922FB25BF2D8000D33EAB /* NSError+PEP.h in Headers */, @@ -747,7 +764,6 @@ 1543DD7E257A3BCF0041EFB5 /* Logger.h in Headers */, 1543DD7C257A3BCF0041EFB5 /* PEPPassphraseUtil.h in Headers */, 15A922F925BF2D8000D33EAB /* PEPIdentity+Reset.h in Headers */, - 15A922EC25BF2D7300D33EAB /* NSArray+Engine.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -758,7 +774,6 @@ 1552D981257660C900A92F71 /* PEPInternalSession.h in Headers */, 1552D974257660C900A92F71 /* Logger.h in Headers */, 1552D98A257660C900A92F71 /* NSError+PEP.h in Headers */, - 1552D987257660C900A92F71 /* NSArray+Engine.h in Headers */, 1552D9522576607900A92F71 /* PEPObjCAdapter.h in Headers */, 1552D9502576607900A92F71 /* PEPSession.h in Headers */, 1552D98C257660C900A92F71 /* PEPSync_Internal.h in Headers */, @@ -769,7 +784,6 @@ 1552D988257660C900A92F71 /* NSArray+Take.h in Headers */, 1552D976257660C900A92F71 /* PEPSessionProvider.h in Headers */, 1552D98B257660C900A92F71 /* NSError+PEP+Internal.h in Headers */, - 1552D96A257660C900A92F71 /* PEPIdentity+Engine.h in Headers */, 1552D972257660C900A92F71 /* PEPCSVScanner.h in Headers */, 1552D94F2576607900A92F71 /* PEPNotifyHandshakeDelegate.h in Headers */, 1552D975257660C900A92F71 /* PEPIdentity+Reset.h in Headers */, @@ -777,7 +791,6 @@ 1552D96B257660C900A92F71 /* PEPPassphraseCache.h in Headers */, 1552D963257660C900A92F71 /* NSString+NormalizePassphrase.h in Headers */, 1552D982257660C900A92F71 /* PEPPassphraseUtil.h in Headers */, - 1552D98E257660C900A92F71 /* PEPMessage+Engine.h in Headers */, 15A9230425BF2D9600D33EAB /* (null) in Headers */, 1552D97C257660C900A92F71 /* PEPPassphraseCacheEntry.h in Headers */, 1552D968257660C900A92F71 /* PEPInternalSession+PassphraseCache.h in Headers */, @@ -811,6 +824,7 @@ 43D44C7C2685B96200638D1C /* PBXTargetDependency */, 430D78E22681E1CF00B12650 /* PBXTargetDependency */, 15A32465260E2A33009D07EB /* PBXTargetDependency */, + 1585EB332698626400B822E1 /* PBXTargetDependency */, ); name = PEPObjCAdapter_iOS; productName = PEPObjCAdapter_iOS; @@ -829,6 +843,7 @@ buildRules = ( ); dependencies = ( + 1585EB2E2698625B00B822E1 /* PBXTargetDependency */, 15A32463260E2A23009D07EB /* PBXTargetDependency */, 4EA8EB0926860BEF00B44B01 /* PBXTargetDependency */, 4E57580F26821A660084F02D /* PBXTargetDependency */, @@ -903,6 +918,10 @@ ProductGroup = 436B444226837F78002624AB /* Products */; ProjectRef = 436B444126837F78002624AB /* PEPObjCAdapterTypes.xcodeproj */; }, + { + ProductGroup = 1585EB16269861D700B822E1 /* Products */; + ProjectRef = 1585EB15269861D700B822E1 /* PEPObjCTypeUtils.xcodeproj */; + }, ); projectRoot = ""; targets = ( @@ -921,6 +940,20 @@ remoteRef = 1552DCBC2577E0B600A92F71 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 1585EB1A269861D700B822E1 /* libPEPObjCTypeUtils_macOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libPEPObjCTypeUtils_macOS.a; + remoteRef = 1585EB19269861D700B822E1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 1585EB312698625B00B822E1 /* libPEPObjCTypeUtils_iOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libPEPObjCTypeUtils_iOS.a; + remoteRef = 1585EB302698625B00B822E1 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 430D78DF2681E13300B12650 /* libPEPObjCAdapterProtocols_iOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1054,10 +1087,8 @@ 159C00A925BB140F00F13E2B /* NSString+NormalizePassphrase.m in Sources */, 159C00A525BB140F00F13E2B /* NSNumber+PEPRating.m in Sources */, 159C00AB25BB140F00F13E2B /* PEPInternalSession+PassphraseCache.m in Sources */, - 159C00A625BB140F00F13E2B /* PEPMessage+Engine.m in Sources */, 1543DCAE257944D20041EFB5 /* PEPSync.m in Sources */, 1543DD43257A3B710041EFB5 /* PEPConstants.m in Sources */, - 159C009F25BB140000F13E2B /* NSArray+Engine.m in Sources */, 1543DCBC257944E80041EFB5 /* PEPPassphraseCache.m in Sources */, 1543DC902579446F0041EFB5 /* PEPObjCAdapter.m in Sources */, 1543DCAD257944CE0041EFB5 /* PEPAutoPointer.m in Sources */, @@ -1071,7 +1102,6 @@ 1543DCC3257944EB0041EFB5 /* PEPPassphraseCacheEntry.m in Sources */, 1543DCA6257944CB0041EFB5 /* PEPSessionProvider.m in Sources */, 1543DC97257944C00041EFB5 /* PEPQueue.m in Sources */, - 159C009125BB13E200F13E2B /* PEPIdentity+Engine.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1080,12 +1110,9 @@ buildActionMask = 2147483647; files = ( 1552D97D257660C900A92F71 /* PEPInternalConstants.m in Sources */, - 1552D967257660C900A92F71 /* PEPIdentity+Engine.m in Sources */, 1552D973257660C900A92F71 /* PEPInternalSession.m in Sources */, 1552D970257660C900A92F71 /* PEPSessionProvider.m in Sources */, 1552D97A257660C900A92F71 /* PEPCopyableThread.m in Sources */, - 1552D983257660C900A92F71 /* PEPMessage+Engine.m in Sources */, - 1552D966257660C900A92F71 /* NSArray+Engine.m in Sources */, 1552D9402576602D00A92F71 /* PEPObjCAdapter_macOS.m in Sources */, 1552D9512576607900A92F71 /* PEPConstants.m in Sources */, 1552D978257660C900A92F71 /* PEPIdentity+Reset.m in Sources */, @@ -1131,6 +1158,16 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 1585EB2E2698625B00B822E1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PEPObjCTypeUtils_macOS; + targetProxy = 1585EB2D2698625B00B822E1 /* PBXContainerItemProxy */; + }; + 1585EB332698626400B822E1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PEPObjCTypeUtils_iOS; + targetProxy = 1585EB322698626400B822E1 /* PBXContainerItemProxy */; + }; 15A32463260E2A23009D07EB /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = pEpEngine_macOS; @@ -1192,6 +1229,7 @@ "$(PROJECT_DIR)/../pEpEngine/src", "$(PROJECT_DIR)/Subprojects/PEPObjCAdapterTypes/build/include", "$(PROJECT_DIR)/Subprojects/PEPObjCAdapterProtocols/build/include", + "$(PROJECT_DIR)/../PEPObjCTypeUtils/**", ); IPHONEOS_DEPLOYMENT_TARGET = "${inherited}"; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -1221,6 +1259,7 @@ "$(PROJECT_DIR)/../pEpEngine/src", "$(PROJECT_DIR)/Subprojects/PEPObjCAdapterTypes/build/include", "$(PROJECT_DIR)/Subprojects/PEPObjCAdapterProtocols/build/include", + "$(PROJECT_DIR)/../PEPObjCTypeUtils/**", ); IPHONEOS_DEPLOYMENT_TARGET = "${inherited}"; MTL_FAST_MATH = YES; @@ -1252,6 +1291,7 @@ "$(PROJECT_DIR)/../pEpEngine/src", "$(PROJECT_DIR)/../local/include/**", "$(PROJECT_DIR)/../pep-toolbox/build/include", + "$(PROJECT_DIR)/../PEPObjCTypeUtils/build/include", ); LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1291,6 +1331,7 @@ "$(PROJECT_DIR)/../pEpEngine/src", "$(PROJECT_DIR)/../local/include/**", "$(PROJECT_DIR)/../pep-toolbox/build/include", + "$(PROJECT_DIR)/../PEPObjCTypeUtils/build/include", ); LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/pEpObjCAdapter/Extensions/NSArray+Engine.h b/pEpObjCAdapter/Extensions/NSArray+Engine.h deleted file mode 100644 index c5d168b..0000000 --- a/pEpObjCAdapter/Extensions/NSArray+Engine.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// NSArray+Engine.h -// pEpiOSAdapter -// -// Created by Dirk Zimmermann on 21.10.20. -// Copyright © 2020 p≡p. All rights reserved. -// - -#import - -#import "stringlist.h" -#import "identity_list.h" -#import "bloblist.h" - -@class PEPIdentity; - -NS_ASSUME_NONNULL_BEGIN - -@interface NSArray (Engine) - -+ (instancetype)arrayFromStringlist:(stringlist_t *)stringList; -+ (NSArray *)arrayFromIdentityList:(identity_list *)identityList; -+ (instancetype)arrayFromStringPairlist:(stringpair_list_t * _Nonnull)stringPairList; -+ (instancetype)arrayFromBloblist:(bloblist_t * _Nonnull)blobList; - -- (stringlist_t * _Nullable)toStringList; - -/// Converts `NSArray` to an engine identity list -- (identity_list * _Nullable)toIdentityList; - -- (stringpair_list_t * _Nullable)toStringPairlist; -- (bloblist_t * _Nullable)toBloblist; - -@end - -NS_ASSUME_NONNULL_END diff --git a/pEpObjCAdapter/Extensions/NSArray+Engine.m b/pEpObjCAdapter/Extensions/NSArray+Engine.m deleted file mode 100644 index a8ec704..0000000 --- a/pEpObjCAdapter/Extensions/NSArray+Engine.m +++ /dev/null @@ -1,166 +0,0 @@ -// -// NSArray+Engine.m -// pEpiOSAdapter -// -// Created by Dirk Zimmermann on 21.10.20. -// Copyright © 2020 p≡p. All rights reserved. -// - -#import - -#import "NSArray+Engine.h" - -#import "PEPIdentity.h" -#import "PEPIdentity+Engine.h" -#import "PEPAttachment.h" - -@implementation NSArray (Engine) - -+ (instancetype)arrayFromStringlist:(stringlist_t * _Nonnull)stringList -{ - NSMutableArray *array = [NSMutableArray array]; - - for (stringlist_t *_sl = stringList; _sl && _sl->value; _sl = _sl->next) { - [array addObject:[NSString stringWithUTF8String:_sl->value]]; - } - - return array; -} - -+ (NSArray *)arrayFromIdentityList:(identity_list *)identityList -{ - NSMutableArray *array = [NSMutableArray array]; - - for (identity_list *_il = identityList; _il && _il->ident; _il = _il->next) { - [array addObject:[PEPIdentity fromStruct:_il->ident]]; - } - - return array; -} - -+ (instancetype)arrayFromStringPairlist:(stringpair_list_t * _Nonnull)stringPairList -{ - NSMutableArray *array = [NSMutableArray array]; - - for (stringpair_list_t *_sl = stringPairList; _sl && _sl->value; _sl = _sl->next) { - [array addObject:[[NSMutableArray alloc ]initWithObjects: - [NSString stringWithUTF8String:_sl->value->key], - [NSString stringWithUTF8String:_sl->value->value], - nil]]; - } - - return array; -} - -+ (instancetype)arrayFromBloblist:(bloblist_t * _Nonnull)blobList -{ - NSMutableArray *array = [NSMutableArray array]; - - for (bloblist_t *_bl = blobList; _bl && _bl->value; _bl = _bl->next) { - PEPAttachment* theAttachment = [[PEPAttachment alloc] - initWithData:[NSData - dataWithBytes:_bl->value length:_bl->size]]; - - if(_bl->filename && _bl->filename[0]) { - theAttachment.filename = [NSString stringWithUTF8String:_bl->filename]; - } - - if(_bl->mime_type && _bl->mime_type[0]) { - theAttachment.mimeType = [NSString stringWithUTF8String:_bl->mime_type]; - } - - theAttachment.contentDisposition = (PEPContentDisposition) _bl->disposition; - - [array addObject:theAttachment]; - } - return array; -} - -- (stringlist_t * _Nullable)toStringList -{ - stringlist_t *sl = new_stringlist(NULL); - if (!sl) - return NULL; - - stringlist_t *_sl = sl; - for (NSString *str in self) { - _sl = stringlist_add(_sl, [[str precomposedStringWithCanonicalMapping] UTF8String]); - } - - return sl; -} - -- (identity_list * _Nullable)toIdentityList -{ - if (self.count == 0) { - return NULL; - } - - identity_list *il = new_identity_list(NULL); - if (!il) - return NULL; - - identity_list *_il = il; - for (PEPIdentity *address in self) { - _il = identity_list_add(_il, [address toStruct]); - } - - return il; -} - -- (stringpair_list_t * _Nullable)toStringPairlist -{ - stringpair_list_t *sl = new_stringpair_list(NULL); - if (!sl) - return NULL; - - stringpair_list_t *_sl = sl; - for (NSArray *pair in self) { - stringpair_t *_sp = new_stringpair( - [[pair[0] precomposedStringWithCanonicalMapping] UTF8String], - [[pair[1] precomposedStringWithCanonicalMapping] UTF8String]); - _sl = stringpair_list_add(_sl, _sp); - } - - return sl; -} - -- (bloblist_t * _Nullable)toBloblist -{ - if (self.count == 0) { - return NULL; - } - - bloblist_t *_bl = new_bloblist(NULL, 0, NULL, NULL); - - if (!_bl) { - return NULL; - } - - bloblist_t *bl =_bl; - - // free() might be the default, but let's be explicit - bl->release_value = (void (*) (char *)) free; - - for (PEPAttachment *theAttachment in self) { - NSData *data = theAttachment.data; - size_t size = [data length]; - - char *buf = malloc(size); - assert(buf); - memcpy(buf, [data bytes], size); - - bl = bloblist_add(bl, buf, size, - [[theAttachment.mimeType - precomposedStringWithCanonicalMapping] - UTF8String], - [[theAttachment.filename - precomposedStringWithCanonicalMapping] - UTF8String]); - - bl->disposition = (content_disposition_type) theAttachment.contentDisposition; - } - return _bl; -} - -@end diff --git a/pEpObjCAdapter/Extensions/PEPIdentity+Engine.h b/pEpObjCAdapter/Extensions/PEPIdentity+Engine.h deleted file mode 100644 index 1dcde28..0000000 --- a/pEpObjCAdapter/Extensions/PEPIdentity+Engine.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// PEPIdentity+Engine.h -// pEpiOSAdapter -// -// Created by Dirk Zimmermann on 21.10.20. -// Copyright © 2020 p≡p. All rights reserved. -// - -#import - -#import "PEPIdentity.h" - -#import "pEpEngine.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface PEPIdentity (Engine) - -/// @Note: If the ident does not contain an address, no PEPIdentity can be constructed. -+ (instancetype _Nullable)fromStruct:(pEp_identity * _Nonnull)identityStruct; - -- (pEp_identity *)toStruct; -- (void)overWriteFromStruct:(pEp_identity * _Nonnull)identityStruct; - -@end - -NS_ASSUME_NONNULL_END diff --git a/pEpObjCAdapter/Extensions/PEPIdentity+Engine.m b/pEpObjCAdapter/Extensions/PEPIdentity+Engine.m deleted file mode 100644 index 6d9c154..0000000 --- a/pEpObjCAdapter/Extensions/PEPIdentity+Engine.m +++ /dev/null @@ -1,81 +0,0 @@ -// -// PEPIdentity+Engine.m -// pEpiOSAdapter -// -// Created by Dirk Zimmermann on 21.10.20. -// Copyright © 2020 p≡p. All rights reserved. -// - -#import - -#import "PEPIdentity+Engine.h" - -@implementation PEPIdentity (Engine) - -+ (instancetype _Nullable)fromStruct:(pEp_identity * _Nonnull)identityStruct -{ - PEPIdentity *identity = nil; - - if (identityStruct->address && identityStruct->address[0]) { - identity = [[PEPIdentity alloc] - initWithAddress:[NSString stringWithUTF8String:identityStruct->address]]; - } - - [identity overWriteFromStruct:identityStruct]; - - return identity; -} - -- (pEp_identity *)toStruct -{ - pEp_identity *ident = new_identity([[self.address - precomposedStringWithCanonicalMapping] UTF8String], - [[self.fingerPrint - precomposedStringWithCanonicalMapping] UTF8String], - [[self.userID - precomposedStringWithCanonicalMapping] UTF8String], - [[self.userName - precomposedStringWithCanonicalMapping] UTF8String]); - - ident->me = self.isOwn; - ident->flags = self.flags; - - if (self.language) { - strncpy(ident->lang, [[self.language - precomposedStringWithCanonicalMapping] UTF8String], 2); - } - - ident->comm_type = (PEP_comm_type) self.commType; - - return ident; -} - -- (void)overWriteFromStruct:(pEp_identity * _Nonnull)identityStruct -{ - if (identityStruct->address && identityStruct->address[0]) { - self.address = [NSString stringWithUTF8String:identityStruct->address]; - } - - if (identityStruct->fpr && identityStruct->fpr[0]) { - self.fingerPrint = [NSString stringWithUTF8String:identityStruct->fpr]; - } - - if (identityStruct->user_id && identityStruct->user_id[0]) { - self.userID = [NSString stringWithUTF8String:identityStruct->user_id]; - } - - if (identityStruct->username && identityStruct->username[0]) { - self.userName = [NSString stringWithUTF8String:identityStruct->username]; - } - - if (identityStruct->lang[0]) { - self.language = [NSString stringWithUTF8String:identityStruct->lang]; - } - - self.commType = (PEPCommType) identityStruct->comm_type; - - self.isOwn = identityStruct->me; - self.flags = identityStruct->flags; -} - -@end diff --git a/pEpObjCAdapter/Extensions/PEPMessage+Engine.h b/pEpObjCAdapter/Extensions/PEPMessage+Engine.h deleted file mode 100644 index 8cc0b62..0000000 --- a/pEpObjCAdapter/Extensions/PEPMessage+Engine.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// PEPMessage+Engine.h -// pEpiOSAdapter -// -// Created by Dirk Zimmermann on 21.10.20. -// Copyright © 2020 p≡p. All rights reserved. -// - -#import - -#import "message.h" - -#import "PEPMessage.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface PEPMessage (Engine) - -+ (instancetype _Nullable)fromStruct:(message * _Nullable)msg; - -- (message * _Nullable)toStruct; - -/// Sets recipients with 0 member to nil -- (instancetype)removeEmptyRecipients; - -- (void)overWriteFromStruct:(message * _Nonnull)message; - -@end - -NS_ASSUME_NONNULL_END diff --git a/pEpObjCAdapter/Extensions/PEPMessage+Engine.m b/pEpObjCAdapter/Extensions/PEPMessage+Engine.m deleted file mode 100644 index 6577a52..0000000 --- a/pEpObjCAdapter/Extensions/PEPMessage+Engine.m +++ /dev/null @@ -1,217 +0,0 @@ -// -// PEPMessage+Engine.m -// pEpiOSAdapter -// -// Created by Dirk Zimmermann on 21.10.20. -// Copyright © 2020 p≡p. All rights reserved. -// - -#import - -#import "PEPMessage+Engine.h" - -#import "pEp_string.h" - -#import "PEPMessage.h" -#import "PEPIdentity+Engine.h" -#import "NSArray+Engine.h" - -@implementation PEPMessage (Engine) - -+ (instancetype _Nullable)fromStruct:(message * _Nullable)msg -{ - if (!msg) { - return nil; - } - PEPMessage *theMessage = [PEPMessage new]; - [theMessage overWriteFromStruct:msg]; - return theMessage; -} - -- (message * _Nullable)toStruct -{ - PEP_msg_direction dir = self.direction == PEPMsgDirectionIncoming ? PEP_dir_incoming : PEP_dir_outgoing; - - message *msg = new_message(dir); - - if (!msg) { - return NULL; - } - - if (self.messageID) - msg->id = new_string([[self.messageID precomposedStringWithCanonicalMapping] - UTF8String], 0); - - if (self.shortMessage) - msg->shortmsg = new_string([[self.shortMessage - precomposedStringWithCanonicalMapping] UTF8String], 0); - - if (self.sentDate) - msg->sent = new_timestamp([self.sentDate timeIntervalSince1970]); - - if (self.receivedDate) - msg->recv = new_timestamp([self.receivedDate timeIntervalSince1970]); - - if (self.from) - msg->from = [self.from toStruct]; - - if (self.to) - msg->to = [self.to toIdentityList]; - - if (self.receivedBy) - msg->recv_by = [self.receivedBy toStruct]; - - if (self.cc) - msg->cc = [self.cc toIdentityList]; - - if (self.bcc) - msg->bcc = [self.bcc toIdentityList]; - - if (self.replyTo) - msg->reply_to = [self.replyTo toIdentityList]; - - if (self.inReplyTo) - msg->in_reply_to = [self.inReplyTo toStringList]; - - if (self.references) - msg->references = [self.references toStringList]; - - if (self.keywords) - msg->keywords = [self.keywords toStringList]; - - if (self.optionalFields) - msg->opt_fields = [self.optionalFields toStringPairlist]; - - if (self.longMessage) - msg->longmsg = new_string([[self.longMessage - precomposedStringWithCanonicalMapping] UTF8String], 0); - - if (self.longMessageFormatted) - msg->longmsg_formatted = new_string([[self.longMessageFormatted - precomposedStringWithCanonicalMapping] - UTF8String], 0); - - if (self.attachments) { - msg->attachments = [self.attachments toBloblist]; - } - - return msg; -} - -- (instancetype)removeEmptyRecipients -{ - if (self.to.count == 0) { - self.to = nil; - } - - if (self.cc.count == 0) { - self.cc = nil; - } - - if (self.bcc.count == 0) { - self.bcc = nil; - } - - return self; -} - -- (void)overWriteFromStruct:(message * _Nonnull)message -{ - [self reset]; - - self.direction = message->dir == PEP_dir_outgoing ? PEPMsgDirectionOutgoing : PEPMsgDirectionIncoming; - - if (message->id) { - self.messageID = [NSString stringWithUTF8String:message->id]; - } - - if (message->shortmsg) { - self.shortMessage = [NSString stringWithUTF8String:message->shortmsg]; - } - - if (message->sent) { - self.sentDate = [NSDate dateWithTimeIntervalSince1970:timegm(message->sent)]; - } - - if (message->recv) { - self.receivedDate = [NSDate dateWithTimeIntervalSince1970:mktime(message->recv)]; - } - - if (message->from) { - self.from = [PEPIdentity fromStruct:message->from]; - } - - if (message->to && message->to->ident) { - self.to = [NSArray arrayFromIdentityList:message->to]; - } - - if (message->recv_by) { - self.receivedBy = [PEPIdentity fromStruct:message->recv_by]; - } - - if (message->cc && message->cc->ident) { - self.cc = [NSArray arrayFromIdentityList:message->cc]; - } - - if (message->bcc && message->bcc->ident) { - self.bcc = [NSArray arrayFromIdentityList:message->bcc]; - } - - if (message->reply_to && message->reply_to->ident) { - self.replyTo = [NSArray arrayFromIdentityList:message->reply_to]; - } - - if (message->in_reply_to) { - self.inReplyTo = [NSArray arrayFromStringlist:message->in_reply_to]; - } - - if (message->references && message->references->value) { - self.references = [NSArray arrayFromStringlist:message->references]; - } - - if (message->keywords && message->keywords->value) { - self.keywords = [NSArray arrayFromStringlist:message->keywords]; - } - - if (message->opt_fields) { - self.optionalFields = [NSArray arrayFromStringPairlist:message->opt_fields]; - } - - if (message->longmsg_formatted) { - self.longMessageFormatted = [NSString stringWithUTF8String:message->longmsg_formatted]; - } - - if (message->longmsg) { - self.longMessage = [NSString stringWithUTF8String:message->longmsg]; - } - - if (message->attachments && message->attachments->value) { - self.attachments = [NSArray arrayFromBloblist:message->attachments]; - } -} - -// MARK: - Private - -- (void)reset -{ - self.messageID = nil; - self.from = nil; - self.to = nil; - self.cc = nil; - self.bcc = nil; - self.shortMessage = nil; - self.longMessage = nil; - self.longMessageFormatted = nil; - self.replyTo = nil; - self.inReplyTo = nil; - self.references = nil; - self.sentDate = nil; - self.receivedDate = nil; - self.attachments = nil; - self.optionalFields = nil; - self.keywords = nil; - self.receivedBy = nil; - self.direction = PEP_dir_incoming; // basically, 0 -} - -@end diff --git a/pEpObjCAdapter/PEPInternalSession.m b/pEpObjCAdapter/PEPInternalSession.m index 7f859b3..df106c5 100644 --- a/pEpObjCAdapter/PEPInternalSession.m +++ b/pEpObjCAdapter/PEPInternalSession.m @@ -8,8 +8,9 @@ #import "PEPInternalSession.h" -#import "PEPConstants.h" +#import +#import "PEPConstants.h" #import "PEPObjCAdapter.h" #import "PEPObjCAdapter+Internal.h" #import "PEPLanguage.h" @@ -26,9 +27,6 @@ #import "PEPPassphraseCache.h" #import "PEPInternalSession+PassphraseCache.h" #import "NSString+NormalizePassphrase.h" -#import "NSArray+Engine.h" -#import "PEPIdentity+Engine.h" -#import "PEPMessage+Engine.h" #import "PEPIdentity+Reset.h" #import "key_reset.h"