IOS-1480 Publish PEPIdentity. IOS-1480
authorDirk Zimmermann <dz@pep.security>
Fri, 22 Feb 2019 16:35:55 +0100
branchIOS-1480
changeset 797ed69de32591f
parent 796 6525f70efefc
child 798 7c857365fd46
IOS-1480 Publish PEPIdentity.
pEpObjCAdapter.xcodeproj/project.pbxproj
pEpObjCAdapter/PEPIdentity.h
pEpObjCAdapter/PEPIdentity.m
pEpObjCAdapter/PEPInternalSession.m
pEpObjCAdapter/PEPMessage.m
pEpObjCAdapter/PEPMessageUtil.m
pEpObjCAdapter/PEPSession.m
pEpObjCAdapterFramework/PEPIdentity.h
pEpObjCAdapterFramework/PEPObjCAdapterFramework.h
pEpObjCTests/PEPMessageUtilTest.m
pEpObjCTests/PEPSessionTest.m
pEpObjCTests/TestUtils/PEPTestUtils.m
     1.1 --- a/pEpObjCAdapter.xcodeproj/project.pbxproj	Wed Feb 20 13:32:28 2019 +0100
     1.2 +++ b/pEpObjCAdapter.xcodeproj/project.pbxproj	Fri Feb 22 16:35:55 2019 +0100
     1.3 @@ -33,6 +33,7 @@
     1.4  		434ED6D6207E27B8000A7590 /* PEPAutoPointer.m in Sources */ = {isa = PBXBuildFile; fileRef = 434ED6D5207E27B8000A7590 /* PEPAutoPointer.m */; };
     1.5  		435665CC2080A6CB00EC5B10 /* NSNumber+PEPRating.m in Sources */ = {isa = PBXBuildFile; fileRef = 435665CB2080A6CB00EC5B10 /* NSNumber+PEPRating.m */; };
     1.6  		435796E31FB5E51A00395A9E /* PEPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 435796E21FB5E51A00395A9E /* PEPMessage.m */; };
     1.7 +		435F5164222045FB006EB11F /* PEPIdentity.h in Headers */ = {isa = PBXBuildFile; fileRef = 435F5163222045FB006EB11F /* PEPIdentity.h */; settings = {ATTRIBUTES = (Public, ); }; };
     1.8  		43676B661C57EA1A00233933 /* B623F674_sec.asc in Resources */ = {isa = PBXBuildFile; fileRef = 43676B641C57EA1A00233933 /* B623F674_sec.asc */; };
     1.9  		439393E6208F375800EB1DBD /* NSObject+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 439393E5208F375800EB1DBD /* NSObject+Extension.m */; };
    1.10  		439393F8208F5B5E00EB1DBD /* NSMutableDictionary+PEP.m in Sources */ = {isa = PBXBuildFile; fileRef = 439393F7208F5B5E00EB1DBD /* NSMutableDictionary+PEP.m */; };
    1.11 @@ -178,7 +179,6 @@
    1.12  		432FA2D51C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_pub.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = meATdontcare_E3BFBCA9248FC681_pub.asc; sourceTree = "<group>"; };
    1.13  		432FA2D61C884FF500DDF874 /* meATdontcare_E3BFBCA9248FC681_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = meATdontcare_E3BFBCA9248FC681_sec.asc; sourceTree = "<group>"; };
    1.14  		433E288E1FA7342000E359B3 /* PEPSessionProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPSessionProtocol.h; sourceTree = "<group>"; };
    1.15 -		433E288F1FA741DE00E359B3 /* PEPIdentity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPIdentity.h; sourceTree = "<group>"; };
    1.16  		433E28901FA741DE00E359B3 /* PEPIdentity.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPIdentity.m; sourceTree = "<group>"; };
    1.17  		434226801D4F60000083ED79 /* PepTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PepTests.m; sourceTree = "<group>"; };
    1.18  		434ED6D4207E27B8000A7590 /* PEPAutoPointer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPAutoPointer.h; sourceTree = "<group>"; };
    1.19 @@ -187,6 +187,7 @@
    1.20  		435665CB2080A6CB00EC5B10 /* NSNumber+PEPRating.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSNumber+PEPRating.m"; sourceTree = "<group>"; };
    1.21  		435796E11FB5E51A00395A9E /* PEPMessage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPMessage.h; sourceTree = "<group>"; };
    1.22  		435796E21FB5E51A00395A9E /* PEPMessage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PEPMessage.m; sourceTree = "<group>"; };
    1.23 +		435F5163222045FB006EB11F /* PEPIdentity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PEPIdentity.h; path = pEpObjCAdapterFramework/PEPIdentity.h; sourceTree = SOURCE_ROOT; };
    1.24  		43676B631C57EA1A00233933 /* 0xB623F674.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 0xB623F674.asc; sourceTree = "<group>"; };
    1.25  		43676B641C57EA1A00233933 /* B623F674_sec.asc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = B623F674_sec.asc; sourceTree = "<group>"; };
    1.26  		438C4393216744DA00C7425B /* PEPSendMessageDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PEPSendMessageDelegate.h; sourceTree = "<group>"; };
    1.27 @@ -363,7 +364,6 @@
    1.28  				15206CC51F8E078B003FF880 /* PEPSession.h */,
    1.29  				15206CC61F8E078B003FF880 /* PEPSession.m */,
    1.30  				433E288E1FA7342000E359B3 /* PEPSessionProtocol.h */,
    1.31 -				433E288F1FA741DE00E359B3 /* PEPIdentity.h */,
    1.32  				433E28901FA741DE00E359B3 /* PEPIdentity.m */,
    1.33  				435796E11FB5E51A00395A9E /* PEPMessage.h */,
    1.34  				435796E21FB5E51A00395A9E /* PEPMessage.m */,
    1.35 @@ -401,6 +401,7 @@
    1.36  		43E3985C221D7E56008E7983 /* PEPObjCAdapterFramework */ = {
    1.37  			isa = PBXGroup;
    1.38  			children = (
    1.39 +				435F5163222045FB006EB11F /* PEPIdentity.h */,
    1.40  				43E3985D221D7E56008E7983 /* PEPObjCAdapterFramework.h */,
    1.41  				43E3985E221D7E56008E7983 /* Info.plist */,
    1.42  			);
    1.43 @@ -437,6 +438,7 @@
    1.44  			isa = PBXHeadersBuildPhase;
    1.45  			buildActionMask = 2147483647;
    1.46  			files = (
    1.47 +				435F5164222045FB006EB11F /* PEPIdentity.h in Headers */,
    1.48  				43E3985F221D7E56008E7983 /* PEPObjCAdapterFramework.h in Headers */,
    1.49  			);
    1.50  			runOnlyForDeploymentPostprocessing = 0;
     2.1 --- a/pEpObjCAdapter/PEPIdentity.h	Wed Feb 20 13:32:28 2019 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,108 +0,0 @@
     2.4 -//
     2.5 -//  PEPIdentity.h
     2.6 -//  pEpObjCAdapter
     2.7 -//
     2.8 -//  Created by Dirk Zimmermann on 30.10.17.
     2.9 -//  Copyright © 2017 p≡p. All rights reserved.
    2.10 -//
    2.11 -
    2.12 -#import <Foundation/Foundation.h>
    2.13 -
    2.14 -#import "PEPSessionProtocol.h"
    2.15 -
    2.16 -@class PEPSession;
    2.17 -
    2.18 -@interface PEPIdentity : NSObject <NSMutableCopying>
    2.19 -
    2.20 -/**
    2.21 - The network address of this identity
    2.22 - */
    2.23 -@property (nonatomic, nonnull) NSString *address;
    2.24 -
    2.25 -/**
    2.26 - The (optional) user ID.
    2.27 - */
    2.28 -@property (nonatomic, nullable) NSString *userID;
    2.29 -
    2.30 -/**
    2.31 - The (optional) user name.
    2.32 - */
    2.33 -@property (nonatomic, nullable) NSString *userName;
    2.34 -
    2.35 -/**
    2.36 - The (optional) fingerprint.
    2.37 - */
    2.38 -@property (nonatomic, nullable) NSString *fingerPrint;
    2.39 -
    2.40 -/**
    2.41 - The (optional) language that this identity uses.
    2.42 - */
    2.43 -@property (nonatomic, nullable) NSString *language;
    2.44 -
    2.45 -/**
    2.46 - The comm type of this identity.
    2.47 - */
    2.48 -@property PEP_comm_type commType;
    2.49 -
    2.50 -/**
    2.51 - Is this one of our own identities?
    2.52 - */
    2.53 -@property BOOL isOwn;
    2.54 -
    2.55 -/**
    2.56 - Comm type contains the PEP_ct_confirmed flag?
    2.57 - */
    2.58 -@property (readonly) BOOL isConfirmed;
    2.59 -
    2.60 -- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    2.61 -                                 userID:(NSString * _Nullable)userID
    2.62 -                               userName:(NSString * _Nullable)userName
    2.63 -                                  isOwn:(BOOL)isOwn
    2.64 -                            fingerPrint:(NSString * _Nullable)fingerPrint
    2.65 -                               commType:(PEP_comm_type)commType
    2.66 -                               language:(NSString * _Nullable)language;
    2.67 -
    2.68 -- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    2.69 -                                 userID:(NSString * _Nullable)userID
    2.70 -                               userName:(NSString * _Nullable)userName
    2.71 -                                  isOwn:(BOOL)isOwn
    2.72 -                            fingerPrint:(NSString * _Nullable)fingerPrint;
    2.73 -
    2.74 -- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    2.75 -                                 userID:(NSString * _Nullable)userID
    2.76 -                               userName:(NSString * _Nullable)userName
    2.77 -                                  isOwn:(BOOL)isOwn;
    2.78 -
    2.79 -- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address;
    2.80 -
    2.81 -- (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary;
    2.82 -
    2.83 -/**
    2.84 - Copy constructor.
    2.85 - */
    2.86 -- (nonnull instancetype)initWithIdentity:(PEPIdentity * _Nonnull)identity;
    2.87 -
    2.88 -/**
    2.89 - This method should be removed once the adapter fully supports objects for identity
    2.90 - and message types insead of dictionaries.
    2.91 - */
    2.92 -- (PEPDict * _Nonnull)dictionary;
    2.93 -
    2.94 -/**
    2.95 - This method should be removed once the adapter fully supports objects for identity
    2.96 - and message types insead of dictionaries.
    2.97 - */
    2.98 -- (PEPMutableDict * _Nonnull)mutableDictionary;
    2.99 -
   2.100 -/**
   2.101 - Is the given identity a pEp user, from the engine's point of view?
   2.102 - */
   2.103 -- (NSNumber * _Nullable)isPEPUser:(PEPSession * _Nullable)session
   2.104 -                            error:(NSError * _Nullable * _Nullable)error;
   2.105 -
   2.106 -/**
   2.107 - Puts all properties into a default/nil state.
   2.108 - */
   2.109 -- (void)reset;
   2.110 -
   2.111 -@end
     3.1 --- a/pEpObjCAdapter/PEPIdentity.m	Wed Feb 20 13:32:28 2019 +0100
     3.2 +++ b/pEpObjCAdapter/PEPIdentity.m	Fri Feb 22 16:35:55 2019 +0100
     3.3 @@ -6,7 +6,7 @@
     3.4  //  Copyright © 2017 p≡p. All rights reserved.
     3.5  //
     3.6  
     3.7 -#import "PEPIdentity.h"
     3.8 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
     3.9  
    3.10  #import "pEpEngine.h"
    3.11  #import "PEPMessageUtil.h"
     4.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Wed Feb 20 13:32:28 2019 +0100
     4.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Fri Feb 22 16:35:55 2019 +0100
     4.3 @@ -15,7 +15,7 @@
     4.4  #import "NSArray+Extension.h"
     4.5  #import "NSDictionary+Extension.h"
     4.6  #import "NSDictionary+Debug.h"
     4.7 -#import "PEPIdentity.h"
     4.8 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
     4.9  #import "PEPMessage.h"
    4.10  #import "NSError+PEP.h"
    4.11  #import "PEPAutoPointer.h"
     5.1 --- a/pEpObjCAdapter/PEPMessage.m	Wed Feb 20 13:32:28 2019 +0100
     5.2 +++ b/pEpObjCAdapter/PEPMessage.m	Fri Feb 22 16:35:55 2019 +0100
     5.3 @@ -7,7 +7,7 @@
     5.4  //
     5.5  
     5.6  #import "PEPMessage.h"
     5.7 -#import "PEPIdentity.h"
     5.8 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
     5.9  
    5.10  #import "NSObject+Extension.h"
    5.11  #import "NSMutableDictionary+PEP.h"
     6.1 --- a/pEpObjCAdapter/PEPMessageUtil.m	Wed Feb 20 13:32:28 2019 +0100
     6.2 +++ b/pEpObjCAdapter/PEPMessageUtil.m	Fri Feb 22 16:35:55 2019 +0100
     6.3 @@ -8,7 +8,7 @@
     6.4  
     6.5  #import "PEPMessageUtil.h"
     6.6  
     6.7 -#import "PEPIdentity.h"
     6.8 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
     6.9  #import "PEPMessage.h"
    6.10  #import "PEPAttachment.h"
    6.11  #import "NSMutableDictionary+PEP.h"
     7.1 --- a/pEpObjCAdapter/PEPSession.m	Wed Feb 20 13:32:28 2019 +0100
     7.2 +++ b/pEpObjCAdapter/PEPSession.m	Fri Feb 22 16:35:55 2019 +0100
     7.3 @@ -10,7 +10,7 @@
     7.4  
     7.5  #import "PEPInternalSession.h"
     7.6  #import "PEPSessionProvider.h"
     7.7 -#import "PEPIdentity.h"
     7.8 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
     7.9  
    7.10  @implementation PEPSession
    7.11  
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/pEpObjCAdapterFramework/PEPIdentity.h	Fri Feb 22 16:35:55 2019 +0100
     8.3 @@ -0,0 +1,108 @@
     8.4 +//
     8.5 +//  PEPIdentity.h
     8.6 +//  pEpObjCAdapter
     8.7 +//
     8.8 +//  Created by Dirk Zimmermann on 30.10.17.
     8.9 +//  Copyright © 2017 p≡p. All rights reserved.
    8.10 +//
    8.11 +
    8.12 +#import <Foundation/Foundation.h>
    8.13 +
    8.14 +#import "PEPSessionProtocol.h"
    8.15 +
    8.16 +@class PEPSession;
    8.17 +
    8.18 +@interface PEPIdentity : NSObject <NSMutableCopying>
    8.19 +
    8.20 +/**
    8.21 + The network address of this identity
    8.22 + */
    8.23 +@property (nonatomic, nonnull) NSString *address;
    8.24 +
    8.25 +/**
    8.26 + The (optional) user ID.
    8.27 + */
    8.28 +@property (nonatomic, nullable) NSString *userID;
    8.29 +
    8.30 +/**
    8.31 + The (optional) user name.
    8.32 + */
    8.33 +@property (nonatomic, nullable) NSString *userName;
    8.34 +
    8.35 +/**
    8.36 + The (optional) fingerprint.
    8.37 + */
    8.38 +@property (nonatomic, nullable) NSString *fingerPrint;
    8.39 +
    8.40 +/**
    8.41 + The (optional) language that this identity uses.
    8.42 + */
    8.43 +@property (nonatomic, nullable) NSString *language;
    8.44 +
    8.45 +/**
    8.46 + The comm type of this identity.
    8.47 + */
    8.48 +@property PEP_comm_type commType;
    8.49 +
    8.50 +/**
    8.51 + Is this one of our own identities?
    8.52 + */
    8.53 +@property BOOL isOwn;
    8.54 +
    8.55 +/**
    8.56 + Comm type contains the PEP_ct_confirmed flag?
    8.57 + */
    8.58 +@property (readonly) BOOL isConfirmed;
    8.59 +
    8.60 +- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    8.61 +                                 userID:(NSString * _Nullable)userID
    8.62 +                               userName:(NSString * _Nullable)userName
    8.63 +                                  isOwn:(BOOL)isOwn
    8.64 +                            fingerPrint:(NSString * _Nullable)fingerPrint
    8.65 +                               commType:(PEP_comm_type)commType
    8.66 +                               language:(NSString * _Nullable)language;
    8.67 +
    8.68 +- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    8.69 +                                 userID:(NSString * _Nullable)userID
    8.70 +                               userName:(NSString * _Nullable)userName
    8.71 +                                  isOwn:(BOOL)isOwn
    8.72 +                            fingerPrint:(NSString * _Nullable)fingerPrint;
    8.73 +
    8.74 +- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    8.75 +                                 userID:(NSString * _Nullable)userID
    8.76 +                               userName:(NSString * _Nullable)userName
    8.77 +                                  isOwn:(BOOL)isOwn;
    8.78 +
    8.79 +- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address;
    8.80 +
    8.81 +- (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary;
    8.82 +
    8.83 +/**
    8.84 + Copy constructor.
    8.85 + */
    8.86 +- (nonnull instancetype)initWithIdentity:(PEPIdentity * _Nonnull)identity;
    8.87 +
    8.88 +/**
    8.89 + This method should be removed once the adapter fully supports objects for identity
    8.90 + and message types insead of dictionaries.
    8.91 + */
    8.92 +- (PEPDict * _Nonnull)dictionary;
    8.93 +
    8.94 +/**
    8.95 + This method should be removed once the adapter fully supports objects for identity
    8.96 + and message types insead of dictionaries.
    8.97 + */
    8.98 +- (PEPMutableDict * _Nonnull)mutableDictionary;
    8.99 +
   8.100 +/**
   8.101 + Is the given identity a pEp user, from the engine's point of view?
   8.102 + */
   8.103 +- (NSNumber * _Nullable)isPEPUser:(PEPSession * _Nullable)session
   8.104 +                            error:(NSError * _Nullable * _Nullable)error;
   8.105 +
   8.106 +/**
   8.107 + Puts all properties into a default/nil state.
   8.108 + */
   8.109 +- (void)reset;
   8.110 +
   8.111 +@end
     9.1 --- a/pEpObjCAdapterFramework/PEPObjCAdapterFramework.h	Wed Feb 20 13:32:28 2019 +0100
     9.2 +++ b/pEpObjCAdapterFramework/PEPObjCAdapterFramework.h	Fri Feb 22 16:35:55 2019 +0100
     9.3 @@ -16,4 +16,4 @@
     9.4  
     9.5  // In this header, you should import all the public headers of your framework using statements like #import <PEPObjCAdapterFramework/PublicHeader.h>
     9.6  
     9.7 -
     9.8 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
    10.1 --- a/pEpObjCTests/PEPMessageUtilTest.m	Wed Feb 20 13:32:28 2019 +0100
    10.2 +++ b/pEpObjCTests/PEPMessageUtilTest.m	Fri Feb 22 16:35:55 2019 +0100
    10.3 @@ -9,7 +9,7 @@
    10.4  #import <XCTest/XCTest.h>
    10.5  
    10.6  #import "PEPMessageUtil.h"
    10.7 -#import "PEPIdentity.h"
    10.8 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
    10.9  
   10.10  @interface PEPMessageUtilTest : XCTestCase
   10.11  @property pEp_identity *pepIdentitySomeOne;
    11.1 --- a/pEpObjCTests/PEPSessionTest.m	Wed Feb 20 13:32:28 2019 +0100
    11.2 +++ b/pEpObjCTests/PEPSessionTest.m	Fri Feb 22 16:35:55 2019 +0100
    11.3 @@ -10,7 +10,7 @@
    11.4  
    11.5  #import "PEPObjCAdapter.h"
    11.6  #import "NSDictionary+Extension.h"
    11.7 -#import "PEPIdentity.h"
    11.8 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
    11.9  #import "PEPMessage.h"
   11.10  #import "PEPAttachment.h"
   11.11  #import "PEPTestUtils.h"
    12.1 --- a/pEpObjCTests/TestUtils/PEPTestUtils.m	Wed Feb 20 13:32:28 2019 +0100
    12.2 +++ b/pEpObjCTests/TestUtils/PEPTestUtils.m	Fri Feb 22 16:35:55 2019 +0100
    12.3 @@ -11,7 +11,7 @@
    12.4  #import "PEPTestUtils.h"
    12.5  
    12.6  #import "NSDictionary+Extension.h"
    12.7 -#import "PEPIdentity.h"
    12.8 +#import <PEPObjCAdapterFramework/PEPIdentity.h>
    12.9  #import "PEPInternalSession.h"
   12.10  #import "PEPMessage.h"
   12.11  #import "PEPSession.h"