IOSAD-160 updateIdentity does NOT invoke myself anymore IOSAD-160
authorDirk Zimmermann <dz@pep.security>
Tue, 03 Dec 2019 14:07:27 +0100
branchIOSAD-160
changeset 1369c22f0fbc9597
parent 1368 1074d7bd40ba
child 1370 d8d271b0bab8
IOSAD-160 updateIdentity does NOT invoke myself anymore
pEpObjCAdapter/PEPInternalSession.m
pEpObjCAdapterFramework/PEPSessionProtocol.h
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Tue Dec 03 14:07:27 2019 +0100
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Tue Dec 03 14:07:27 2019 +0100
     1.3 @@ -556,24 +556,20 @@
     1.4  
     1.5  - (BOOL)updateIdentity:(PEPIdentity * _Nonnull)identity error:(NSError * _Nullable * _Nullable)error
     1.6  {
     1.7 -    if (identity.isOwn) {
     1.8 -        return [self mySelf:identity error:error];
     1.9 -    } else {
    1.10 -        pEp_identity *ident = PEP_identityToStruct(identity);
    1.11 +    pEp_identity *ident = PEP_identityToStruct(identity);
    1.12  
    1.13 -        PEPStatus status = (PEPStatus) update_identity(_session, ident);
    1.14 -        
    1.15 -        if ([NSError setError:error fromPEPStatus:status]) {
    1.16 -            free_identity(ident);
    1.17 -            return NO;
    1.18 -        }
    1.19 +    PEPStatus status = (PEPStatus) update_identity(_session, ident);
    1.20  
    1.21 -        [identity reset];
    1.22 -        [identity setValuesForKeysWithDictionary:PEP_identityDictFromStruct(ident)];
    1.23 +    if ([NSError setError:error fromPEPStatus:status]) {
    1.24          free_identity(ident);
    1.25 +        return NO;
    1.26 +    }
    1.27  
    1.28 -        return YES;
    1.29 -    }
    1.30 +    [identity reset];
    1.31 +    [identity setValuesForKeysWithDictionary:PEP_identityDictFromStruct(ident)];
    1.32 +    free_identity(ident);
    1.33 +
    1.34 +    return YES;
    1.35  }
    1.36  
    1.37  - (BOOL)trustPersonalKey:(PEPIdentity * _Nonnull)identity
     2.1 --- a/pEpObjCAdapterFramework/PEPSessionProtocol.h	Tue Dec 03 14:07:27 2019 +0100
     2.2 +++ b/pEpObjCAdapterFramework/PEPSessionProtocol.h	Tue Dec 03 14:07:27 2019 +0100
     2.3 @@ -97,11 +97,13 @@
     2.4  pEpSyncEnabled:(BOOL)pEpSyncEnabled
     2.5           error:(NSError * _Nullable * _Nullable)error;
     2.6  
     2.7 -/**
     2.8 - Supplement missing information for an arbitrary identity (used for communication partners).
     2.9 - Will call the engine's myself() or update_identity() internally, depending on the given
    2.10 - identity.
    2.11 - */
    2.12 +/// Calls the engine's update_identity on the given identity.
    2.13 +/// @note Prior this was invoking myself if the identity was identified as being an own
    2.14 +/// identity, but this not the case anymore, since it cannot decide if the identity should
    2.15 +/// participate in pEp sync or not.
    2.16 +/// @return Returns YES on success, NO on error, setting `*error` accordingly if possible.
    2.17 +/// @param identity The identity for which to call update_identity.
    2.18 +/// @param error Standart cocoa error handling.
    2.19  - (BOOL)updateIdentity:(PEPIdentity * _Nonnull)identity
    2.20                   error:(NSError * _Nullable * _Nullable)error;
    2.21