Browse Source

IOSAD-233 Use "for" and "with" in method names

IOSAD-233
Dirk Zimmermann 7 months ago
parent
commit
408f5abe27
6 changed files with 38 additions and 38 deletions
  1. +6
    -6
      Subprojects/PEPObjCAdapterProtocols/PublicHeaders/PEPSessionProtocolTKA.h
  2. +3
    -3
      build-mac/pEpObjCAdapterTests/TKA/PEPInternalSessionTKATest.m
  3. +9
    -9
      build-mac/pEpObjCAdapterTests/TKA/PEPSessionTKATest.m
  4. +12
    -12
      src/PEPSession.m
  5. +4
    -4
      src/TKA/PEPInternalSession+TKA.h
  6. +4
    -4
      src/TKA/PEPInternalSession+TKA.m

+ 6
- 6
Subprojects/PEPObjCAdapterProtocols/PublicHeaders/PEPSessionProtocolTKA.h View File

@ -17,14 +17,14 @@ NS_ASSUME_NONNULL_BEGIN
///
/// Sets the delegate that will receive key changes via TKA. The delegate will be owned by the adapter and can be unset
/// (by calling this method with a nil delegate). That's the reason the delegate parameter is nullable.
- (void)tkaSubscribeKeychangeDelegate:(id<PEPTKADelegate> _Nullable)delegate
errorCallback:(void (^)(NSError *error))errorCallback
successCallback:(void (^)(void))successCallback;
- (void)tkaSubscribeWithKeychangeDelegate:(id<PEPTKADelegate> _Nullable)delegate
errorCallback:(void (^)(NSError *error))errorCallback
successCallback:(void (^)(void))successCallback;
/// Wraps the engine's `tka_request_temp_key`.
- (void)tkaRequestTempKeyMe:(PEPIdentity *)me partner:(PEPIdentity *)partner
errorCallback:(void (^)(NSError *error))errorCallback
successCallback:(void (^)(void))successCallback;
- (void)tkaRequestTempKeyForMe:(PEPIdentity *)me partner:(PEPIdentity *)partner
errorCallback:(void (^)(NSError *error))errorCallback
successCallback:(void (^)(void))successCallback;
@end


+ 3
- 3
build-mac/pEpObjCAdapterTests/TKA/PEPInternalSessionTKATest.m View File

@ -47,7 +47,7 @@
expDealloced:expDealloced];
NSError *error = nil;
XCTAssertTrue([session tkaSubscribeKeychangeDelegate:delegate error:&error]);
XCTAssertTrue([session tkaSubscribeWithKeychangeDelegate:delegate error:&error]);
XCTAssertNil(error);
// now owned by the adapter
@ -66,13 +66,13 @@
isOwn:NO];
error = nil;
XCTAssertTrue([session tkaRequestTempKeyMe:me partner:other error:&error]);
XCTAssertTrue([session tkaRequestTempKeyForMe:me partner:other error:&error]);
XCTAssertNil(error);
[self waitForExpectations:@[expDelegateCalled] timeout:PEPTestInternalFastTimeout];
error = nil;
XCTAssertTrue([session tkaSubscribeKeychangeDelegate:nil error:&error]);
XCTAssertTrue([session tkaSubscribeWithKeychangeDelegate:nil error:&error]);
XCTAssertNil(error);
[self waitForExpectations:@[expDealloced] timeout:PEPTestInternalFastTimeout];


+ 9
- 9
build-mac/pEpObjCAdapterTests/TKA/PEPSessionTKATest.m View File

@ -58,7 +58,7 @@
isOwn:NO];
error = nil;
XCTAssertTrue([self tkaRequestTempKeySession:session me:me partner:other error:&error]);
XCTAssertTrue([self tkaRequestTempKeyWithSession:session me:me partner:other error:&error]);
XCTAssertNil(error);
[self waitForExpectations:@[expDelegateCalled] timeout:PEPTestInternalFastTimeout];
@ -84,8 +84,8 @@
__block BOOL success = NO;
XCTestExpectation *expDelegateSet = [self expectationWithDescription:@"expDelegateSet"];
[session tkaSubscribeKeychangeDelegate:delegate
errorCallback:^(NSError * _Nonnull error) {
[session tkaSubscribeWithKeychangeDelegate:delegate
errorCallback:^(NSError * _Nonnull error) {
errorResult = error;
success = NO;
[expDelegateSet fulfill];
@ -105,16 +105,16 @@
}
/// Synchronizes the async version from `PEPSession`.
- (BOOL)tkaRequestTempKeySession:(PEPSession * _Nonnull)session
me:(PEPIdentity *)me partner:(PEPIdentity *)partner
error:(NSError * _Nullable * _Nullable)error {
- (BOOL)tkaRequestTempKeyWithSession:(PEPSession * _Nonnull)session
me:(PEPIdentity *)me partner:(PEPIdentity *)partner
error:(NSError * _Nullable * _Nullable)error {
__block NSError *errorResult = nil;
__block BOOL success = NO;
XCTestExpectation *expDelegateSet = [self expectationWithDescription:@"expDelegateSet"];
[session tkaRequestTempKeyMe:me
partner:partner
errorCallback:^(NSError * _Nonnull error) {
[session tkaRequestTempKeyForMe:me
partner:partner
errorCallback:^(NSError * _Nonnull error) {
errorResult = error;
success = NO;
[expDelegateSet fulfill];


+ 12
- 12
src/PEPSession.m View File

@ -642,13 +642,13 @@ successCallback:(void (^)(NSString *log))successCallback
// MARK: - TKA
- (void)tkaSubscribeKeychangeDelegate:(nullable id<PEPTKADelegate>)delegate
errorCallback:(nonnull void (^)(NSError * _Nonnull))errorCallback
successCallback:(nonnull void (^)(void))successCallback {
- (void)tkaSubscribeWithKeychangeDelegate:(nullable id<PEPTKADelegate>)delegate
errorCallback:(nonnull void (^)(NSError * _Nonnull))errorCallback
successCallback:(nonnull void (^)(void))successCallback {
dispatch_async(queue, ^{
NSError *error = nil;
BOOL success = [[PEPSessionProvider session] tkaSubscribeKeychangeDelegate:delegate
error:&error];
BOOL success = [[PEPSessionProvider session] tkaSubscribeWithKeychangeDelegate:delegate
error:&error];
if (success) {
successCallback();
} else {
@ -657,15 +657,15 @@ successCallback:(void (^)(NSString *log))successCallback
});
}
- (void)tkaRequestTempKeyMe:(nonnull PEPIdentity *)me
partner:(nonnull PEPIdentity *)partner
errorCallback:(nonnull void (^)(NSError * _Nonnull))errorCallback
successCallback:(nonnull void (^)(void))successCallback {
- (void)tkaRequestTempKeyForMe:(nonnull PEPIdentity *)me
partner:(nonnull PEPIdentity *)partner
errorCallback:(nonnull void (^)(NSError * _Nonnull))errorCallback
successCallback:(nonnull void (^)(void))successCallback {
dispatch_async(queue, ^{
NSError *error = nil;
BOOL success = [[PEPSessionProvider session] tkaRequestTempKeyMe:me
partner:partner
error:&error];
BOOL success = [[PEPSessionProvider session] tkaRequestTempKeyForMe:me
partner:partner
error:&error];
if (success) {
successCallback();
} else {


+ 4
- 4
src/TKA/PEPInternalSession+TKA.h View File

@ -20,12 +20,12 @@ NS_ASSUME_NONNULL_BEGIN
/// @note The delegate parameter will be stored with a strong reference.
/// Because it's strongly referenced, it is nullable intentionally, so you can set it to nil
/// in order to break memory cycles.
- (BOOL)tkaSubscribeKeychangeDelegate:(id<PEPTKADelegate> _Nullable)delegate
error:(NSError * _Nullable * _Nullable)error;
- (BOOL)tkaSubscribeWithKeychangeDelegate:(id<PEPTKADelegate> _Nullable)delegate
error:(NSError * _Nullable * _Nullable)error;
/// Wraps the engine's `tka_request_temp_key`.
- (BOOL)tkaRequestTempKeyMe:(PEPIdentity *)me partner:(PEPIdentity *)partner
error:(NSError * _Nullable * _Nullable)error;
- (BOOL)tkaRequestTempKeyForMe:(PEPIdentity *)me partner:(PEPIdentity *)partner
error:(NSError * _Nullable * _Nullable)error;
@end


+ 4
- 4
src/TKA/PEPInternalSession+TKA.m View File

@ -50,8 +50,8 @@ PEP_STATUS tkaKeychangeCallback(const pEp_identity *me,
// MARK: - Internal Session API
- (BOOL)tkaSubscribeKeychangeDelegate:(id<PEPTKADelegate> _Nullable)delegate
error:(NSError * _Nullable * _Nullable)error {
- (BOOL)tkaSubscribeWithKeychangeDelegate:(id<PEPTKADelegate> _Nullable)delegate
error:(NSError * _Nullable * _Nullable)error {
s_tkaDelegate = delegate;
if (delegate != nil) {
@ -63,8 +63,8 @@ PEP_STATUS tkaKeychangeCallback(const pEp_identity *me,
return YES;
}
- (BOOL)tkaRequestTempKeyMe:(PEPIdentity *)me partner:(PEPIdentity *)partner
error:(NSError * _Nullable * _Nullable)error {
- (BOOL)tkaRequestTempKeyForMe:(PEPIdentity *)me partner:(PEPIdentity *)partner
error:(NSError * _Nullable * _Nullable)error {
pEp_identity *engineMe = [PEPObjCTypeConversionUtil structFromPEPIdentity:me];
if (engineMe == NULL) {
return [PEPStatusNSErrorUtil setError:error fromPEPStatus:PEPStatusIllegalValue];


Loading…
Cancel
Save