IOSAD-104 wrap set_identity_flags
authorDirk Zimmermann <dirk@pep-project.org>
Tue, 06 Nov 2018 11:08:55 +0100
changeset 76841f5d64f03c1
parent 696 4c880b7e0441
child 769 b5f3e9bfb30b
IOSAD-104 wrap set_identity_flags
pEpObjCAdapter/PEPInternalSession.m
pEpObjCAdapter/PEPSession.m
pEpObjCAdapter/PEPSessionProtocol.h
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Fri Oct 05 13:20:52 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Tue Nov 06 11:08:55 2018 +0100
     1.3 @@ -886,4 +886,22 @@
     1.4      config_passive_mode(_session, enabled);
     1.5  }
     1.6  
     1.7 +- (BOOL)setFlags:(identity_flags_t)flags
     1.8 +     forIdentity:(PEPIdentity *)identity
     1.9 +           error:(NSError * _Nullable * _Nullable)error
    1.10 +{
    1.11 +    pEp_identity *ident = PEP_identityToStruct(identity);
    1.12 +    PEP_STATUS status = set_identity_flags(self.session, ident, flags);
    1.13 +    free_identity(ident);
    1.14 +
    1.15 +    if (status == PEP_STATUS_OK) {
    1.16 +        return YES;
    1.17 +    } else {
    1.18 +        if (error) {
    1.19 +            *error = [NSError errorWithPEPStatus:status];
    1.20 +        }
    1.21 +        return NO;
    1.22 +    }
    1.23 +}
    1.24 +
    1.25  @end
     2.1 --- a/pEpObjCAdapter/PEPSession.m	Fri Oct 05 13:20:52 2018 +0200
     2.2 +++ b/pEpObjCAdapter/PEPSession.m	Tue Nov 06 11:08:55 2018 +0100
     2.3 @@ -336,4 +336,12 @@
     2.4      return [session configurePassiveModeEnabled:enabled];
     2.5  }
     2.6  
     2.7 +- (BOOL)setFlags:(identity_flags_t)flags
     2.8 +     forIdentity:(PEPIdentity *)identity
     2.9 +           error:(NSError * _Nullable * _Nullable)error
    2.10 +{
    2.11 +    PEPInternalSession *session = [PEPSessionProvider session];
    2.12 +    return [session setFlags:flags forIdentity:identity error:error];
    2.13 +}
    2.14 +
    2.15  @end
     3.1 --- a/pEpObjCAdapter/PEPSessionProtocol.h	Fri Oct 05 13:20:52 2018 +0200
     3.2 +++ b/pEpObjCAdapter/PEPSessionProtocol.h	Tue Nov 06 11:08:55 2018 +0100
     3.3 @@ -241,4 +241,11 @@
     3.4   */
     3.5  - (void)configurePassiveModeEnabled:(BOOL)enabled;
     3.6  
     3.7 +/**
     3.8 + Wraps set_identity_flags
     3.9 + */
    3.10 +- (BOOL)setFlags:(identity_flags_t)flags
    3.11 +     forIdentity:(PEPIdentity *)identity
    3.12 +           error:(NSError * _Nullable * _Nullable)error;
    3.13 +
    3.14  @end