merge IOSAD-143
authorDirk Zimmermann <dz@pep.security>
Wed, 02 Oct 2019 09:27:09 +0200
changeset 12991a8cd3285b52
parent 1293 dd19c6e2fcf8
parent 1298 7c7473e9766b
child 1300 0a0968bb887a
child 1302 91a1773359ac
child 1313 b5e95747cf96
merge IOSAD-143
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Mon Sep 30 10:16:22 2019 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Wed Oct 02 09:27:09 2019 +0200
     1.3 @@ -24,7 +24,7 @@
     1.4  #import "PEPAutoPointer.h"
     1.5  #import "NSNumber+PEPRating.h"
     1.6  #import "NSMutableDictionary+PEP.h"
     1.7 -#import "PEPSync_Internal.h"
     1.8 +#import "PEPSync_Internal.h" // for [PEPSync createSession:]
     1.9  #import "PEPInternalConstants.h"
    1.10  
    1.11  #import "key_reset.h"
    1.12 @@ -37,10 +37,12 @@
    1.13      if (self) {
    1.14          [PEPInternalSession setupTrustWordsDB];
    1.15  
    1.16 -        NSError *error = nil;
    1.17 -        _session = [PEPSync createSession:&error];
    1.18 +        // Get an engine session from PEPSync, because its creation requires callbacks
    1.19 +        // that PEPSync is responsible for.
    1.20 +        _session = [PEPSync createSession:nil];
    1.21  
    1.22 -        if (error) {
    1.23 +        // [PEPSync createSession:] has already logged any errors.
    1.24 +        if (!_session) {
    1.25              return nil;
    1.26          }
    1.27      }
     2.1 --- a/pEpObjCAdapter/PEPSync_Internal.h	Mon Sep 30 10:16:22 2019 +0200
     2.2 +++ b/pEpObjCAdapter/PEPSync_Internal.h	Wed Oct 02 09:27:09 2019 +0200
     2.3 @@ -13,8 +13,15 @@
     2.4   Internal methods of PEPSync.
     2.5   */
     2.6  @interface PEPSync : NSObject
     2.7 +
     2.8  /**
     2.9 - Creates an engine session.
    2.10 + Creates an engine session (PEP_SESSION).
    2.11 +
    2.12 + PEPSync is responsible for engine session creation because the engine
    2.13 + has mandatory callback parameters on its init, which PEPSync is managing.
    2.14 +
    2.15 + @param error The usual cocoa error handling.
    2.16 + @return A valid engine PEP_SESSION or NULL if there was an error.
    2.17   */
    2.18  + (PEP_SESSION _Nullable)createSession:(NSError * _Nullable * _Nullable)error;
    2.19