Browse Source

APPLEMAIL-35 Small refactor.

APPLEMAIL-35
David Alarcon 1 year ago
parent
commit
68aee843c5
2 changed files with 24 additions and 12 deletions
  1. +12
    -1
      Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCApiClient/XPCService/PEPObjCAdapterXPCApiClientService.m
  2. +12
    -11
      Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCService/XPCService/PEPObjCAdapterXPCApi.m

+ 12
- 1
Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCApiClient/XPCService/PEPObjCAdapterXPCApiClientService.m View File

@ -140,7 +140,18 @@ successCallback:(nonnull void (^)(PEPIdentity * _Nonnull))successCallback {
PEPDecryptFlags flags,
BOOL isFormerlyEncryptedReuploadedMessage))successCallback {
[[self.connection remoteObjectProxyWithErrorHandler:errorCallback] decryptMessage:message flags:flags extraKeys:extraKeys resultBlock:^(PEPObjCAdapterXpcApiResult * _Nonnull result) {
[[self.connection remoteObjectProxyWithErrorHandler:errorCallback] decryptMessage:message
flags:flags
extraKeys:extraKeys
resultBlock:^(PEPObjCAdapterXpcApiResult * _Nonnull result) {
/*
@[srcMessage,
dstMessage,
keyList,
@(rating),
@(flags),
@(isFormerlyEncryptedReuploadedMessage)]
*/
PEPMessage *srcMessage = result.result[0];
PEPMessage *dstMessage = result.result[1];
PEPStringList *keyList = result.result[2];


+ 12
- 11
Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCService/XPCService/PEPObjCAdapterXPCApi.m View File

@ -17,15 +17,6 @@ typedef void (^resultErrorBlock)(NSError *, resultCallback);
@implementation PEPObjCAdapterXPCApi
//void resultErrorBlock = ^void(NSError * _Nonnull error, resultCallback resultCallback) {
// PEPObjCAdapterXpcApiResult *result = [[PEPObjCAdapterXpcApiResult alloc] initWithResult:nil error:error];
// resultCallback(result);
//};
//void (^resultErrorBlock)(NSError *, void (^)(PEPObjCAdapterXpcApiResult * _Nonnull)) = ^void(NSError * _Nonnull error, (void (^)(PEPObjCAdapterXpcApiResult * _Nonnull))resultCallback) {
// PEPObjCAdapterXpcApiResult *result = [[PEPObjCAdapterXpcApiResult alloc] initWithResult:nil error:error];
// resultCallback(result);
//};
- (void)myself:(PEPIdentity *)identity resultBlock:(void (^)(PEPObjCAdapterXpcApiResult * _Nonnull))resultCallback {
PEPSession *session = [PEPSession new];
@ -119,9 +110,19 @@ typedef void (^resultErrorBlock)(NSError *, resultCallback);
initWithResult:nil
error:error];
resultCallback(result);
} successCallback:^(PEPMessage * _Nonnull srcMessage, PEPMessage * _Nonnull dstMessage, PEPStringList * _Nonnull keyList, PEPRating rating, PEPDecryptFlags flags, BOOL isFormerlyEncryptedReuploadedMessage) {
} successCallback:^(PEPMessage * _Nonnull srcMessage,
PEPMessage * _Nonnull dstMessage,
PEPStringList * _Nonnull keyList,
PEPRating rating,
PEPDecryptFlags flags,
BOOL isFormerlyEncryptedReuploadedMessage) {
PEPObjCAdapterXpcApiResult *result = [[PEPObjCAdapterXpcApiResult alloc]
initWithResult:@[srcMessage, dstMessage, keyList, @(rating), @(flags), @(isFormerlyEncryptedReuploadedMessage)]
initWithResult:@[srcMessage,
dstMessage,
keyList,
@(rating),
@(flags),
@(isFormerlyEncryptedReuploadedMessage)]
error:nil];
resultCallback(result);
}];


Loading…
Cancel
Save