IOSAD-123 PEPIdentity.userID nullable. IOSAD-123
authorDirk Zimmermann <dz@pep.security>
Wed, 24 Jul 2019 10:31:30 +0200
branchIOSAD-123
changeset 109973b5bd4d21f5
parent 1097 e4bd8bed57d9
child 1100 56e378020b6e
IOSAD-123 PEPIdentity.userID nullable.
pEpObjCAdapter/PEPIdentity.m
pEpObjCAdapter/PEPMessageUtil.m
pEpObjCAdapterFramework/PEPIdentity.h
     1.1 --- a/pEpObjCAdapter/PEPIdentity.m	Tue Jul 23 16:05:32 2019 +0200
     1.2 +++ b/pEpObjCAdapter/PEPIdentity.m	Wed Jul 24 10:31:30 2019 +0200
     1.3 @@ -18,7 +18,7 @@
     1.4  @implementation PEPIdentity
     1.5  
     1.6  - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
     1.7 -                                 userID:(NSString * _Nonnull)userID
     1.8 +                                 userID:(NSString * _Nullable)userID
     1.9                                 userName:(NSString * _Nullable)userName
    1.10                                    isOwn:(BOOL)isOwn
    1.11                              fingerPrint:(NSString * _Nullable)fingerPrint
    1.12 @@ -37,7 +37,7 @@
    1.13  }
    1.14  
    1.15  - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    1.16 -                                 userID:(NSString * _Nonnull)userID
    1.17 +                                 userID:(NSString * _Nullable)userID
    1.18                                 userName:(NSString * _Nullable)userName
    1.19                                    isOwn:(BOOL)isOwn
    1.20                              fingerPrint:(NSString * _Nullable)fingerPrint
    1.21 @@ -47,7 +47,7 @@
    1.22  }
    1.23  
    1.24  - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    1.25 -                                 userID:(NSString * _Nonnull)userID
    1.26 +                                 userID:(NSString * _Nullable)userID
    1.27                                 userName:(NSString * _Nullable)userName
    1.28                                    isOwn:(BOOL)isOwn
    1.29  {
    1.30 @@ -56,9 +56,8 @@
    1.31  }
    1.32  
    1.33  - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    1.34 -                                 userID:(NSString * _Nonnull)userID
    1.35  {
    1.36 -    return [self initWithAddress:address userID:userID userName:nil isOwn:NO fingerPrint:nil
    1.37 +    return [self initWithAddress:address userID:nil userName:nil isOwn:NO fingerPrint:nil
    1.38                          commType:PEPCommTypeUnknown language:nil];
    1.39  }
    1.40  
     2.1 --- a/pEpObjCAdapter/PEPMessageUtil.m	Tue Jul 23 16:05:32 2019 +0200
     2.2 +++ b/pEpObjCAdapter/PEPMessageUtil.m	Wed Jul 24 10:31:30 2019 +0200
     2.3 @@ -212,10 +212,14 @@
     2.4  PEPIdentity *PEP_identityFromStruct(pEp_identity *ident)
     2.5  {
     2.6      PEPIdentity *identity = nil;
     2.7 -    if (ident->address && ident->address[0] && ident->user_id && ident->user_id[0]) {
     2.8 +
     2.9 +    if (ident->address && ident->address[0]) {
    2.10          identity = [[PEPIdentity alloc]
    2.11 -                    initWithAddress:[NSString stringWithUTF8String:ident->address]
    2.12 -                    userID:[NSString stringWithUTF8String:ident->user_id]];
    2.13 +                    initWithAddress:[NSString stringWithUTF8String:ident->address]];
    2.14 +    }
    2.15 +
    2.16 +    if (ident->user_id && ident->user_id[0]) {
    2.17 +        identity.userID = [NSString stringWithUTF8String:ident->user_id];
    2.18      }
    2.19  
    2.20      if (ident->fpr && ident->fpr[0]) {
     3.1 --- a/pEpObjCAdapterFramework/PEPIdentity.h	Tue Jul 23 16:05:32 2019 +0200
     3.2 +++ b/pEpObjCAdapterFramework/PEPIdentity.h	Wed Jul 24 10:31:30 2019 +0200
     3.3 @@ -55,7 +55,7 @@
     3.4  @property (readonly) BOOL isConfirmed;
     3.5  
     3.6  - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
     3.7 -                                 userID:(NSString * _Nonnull)userID
     3.8 +                                 userID:(NSString * _Nullable)userID
     3.9                                 userName:(NSString * _Nullable)userName
    3.10                                    isOwn:(BOOL)isOwn
    3.11                              fingerPrint:(NSString * _Nullable)fingerPrint
    3.12 @@ -63,18 +63,17 @@
    3.13                                 language:(NSString * _Nullable)language;
    3.14  
    3.15  - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    3.16 -                                 userID:(NSString * _Nonnull)userID
    3.17 +                                 userID:(NSString * _Nullable)userID
    3.18                                 userName:(NSString * _Nullable)userName
    3.19                                    isOwn:(BOOL)isOwn
    3.20                              fingerPrint:(NSString * _Nullable)fingerPrint;
    3.21  
    3.22  - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    3.23 -                                 userID:(NSString * _Nonnull)userID
    3.24 +                                 userID:(NSString * _Nullable)userID
    3.25                                 userName:(NSString * _Nullable)userName
    3.26                                    isOwn:(BOOL)isOwn;
    3.27  
    3.28 -- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    3.29 -                                 userID:(NSString * _Nonnull)userID;
    3.30 +- (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address;
    3.31  
    3.32  - (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary;
    3.33