Browse Source

Merge branch 'APPLEMAIL-42'

* APPLEMAIL-42:
  APPLEMAIL-42 Fix install scheme.
  APPLEMAIL-42 Delete unused code. Add install scheme.
  APPLEMAIL-42 Add colorFromRating xpc call.
APPLEMAIL-58
David Alarcon 1 year ago
parent
commit
7832803684
5 changed files with 226 additions and 0 deletions
  1. +25
    -0
      Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCApiClient/XPCService/PEPObjCAdapterXPCApiClientService.m
  2. +29
    -0
      Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCService/XPCService/PEPObjCAdapterXPCApi.m
  3. +7
    -0
      Subprojects/PEPObjCAdapterXPCService/Shared/PEPObjCAdapterXpcApiProtocol.h
  4. +151
    -0
      pEpMacOSAdapter.xcodeproj/xcshareddata/xcschemes/Install pEpMacOSAdapter Service.xcscheme
  5. +14
    -0
      pEpMacOSAdapter.xcodeproj/xcshareddata/xcschemes/pEpMacOSAdapter.xcscheme

+ 25
- 0
Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCApiClient/XPCService/PEPObjCAdapterXPCApiClientService.m View File

@ -87,4 +87,29 @@ successCallback:(nonnull void (^)(PEPIdentity * _Nonnull))successCallback {
}];
}
- (void)outgoingRatingForMessage:(PEPMessage *)theMessage
errorCallback:(void (^)(NSError * _Nonnull))errorCallback
successCallback:(void (^)(PEPRating))successCallback {
[[self.connection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
errorCallback(error);
}] outgoingRatingForMessage:theMessage resultBlock:^(PEPObjCAdapterXpcApiResult * _Nonnull result) {
PEPRating pEpRating = [(NSNumber *)[result.result firstObject] intValue];
successCallback(pEpRating);
}];
}
- (PEPColor)colorFromRating:(PEPRating)rating {
__block PEPColor color = PEPColorNoColor;
[[self.connection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
NSLog(@"[PEP4APPLEMAIL] Error: %@", error);
// Nothing to do
}] colorFromRating:rating resultBlock:^(PEPObjCAdapterXpcApiResult * _Nonnull result) {
color = [(NSNumber *)[result.result firstObject] intValue];
}];
return color;
}
@end

+ 29
- 0
Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCService/XPCService/PEPObjCAdapterXPCApi.m View File

@ -46,4 +46,33 @@
}];
}
- (void)outgoingRatingForMessage:(PEPMessage *)theMessage
resultBlock:(void (^)(PEPObjCAdapterXpcApiResult * _Nonnull))resultCallback {
NSLog(@"%s", __PRETTY_FUNCTION__);
PEPSession *session = [PEPSession new];
[session outgoingRatingForMessage:theMessage errorCallback:^(NSError * _Nonnull error) {
PEPObjCAdapterXpcApiResult *result = [[PEPObjCAdapterXpcApiResult alloc]
initWithResult:nil
error:error];
resultCallback(result);
} successCallback:^(PEPRating rating) {
PEPObjCAdapterXpcApiResult *result = [[PEPObjCAdapterXpcApiResult alloc]
initWithResult:@[@(rating)]
error:nil];
resultCallback(result);
}];
}
- (void)colorFromRating:(PEPRating)rating
resultBlock:(void (^)(PEPObjCAdapterXpcApiResult * _Nonnull))resultCallback {
NSLog(@"%s", __PRETTY_FUNCTION__);
PEPSession *session = [PEPSession new];
PEPColor color = [session colorFromRating:rating];
PEPObjCAdapterXpcApiResult *result = [[PEPObjCAdapterXpcApiResult alloc]
initWithResult:@[@(color)]
error:nil];
resultCallback(result);
}
@end

+ 7
- 0
Subprojects/PEPObjCAdapterXPCService/Shared/PEPObjCAdapterXpcApiProtocol.h View File

@ -23,6 +23,13 @@ NS_ASSUME_NONNULL_BEGIN
extraKeys:(PEPStringList *_Nullable)extraKeys
encFormat:(PEPEncFormat)encFormat
resultBlock:(void (^)(PEPObjCAdapterXpcApiResult *))resultCallback;
- (void)outgoingRatingForMessage:(PEPMessage *)theMessage
resultBlock:(void (^)(PEPObjCAdapterXpcApiResult *))resultCallback;
- (void)colorFromRating:(PEPRating)rating
resultBlock:(void (^)(PEPObjCAdapterXpcApiResult *))resultCallback;
@end
NS_ASSUME_NONNULL_END

+ 151
- 0
pEpMacOSAdapter.xcodeproj/xcshareddata/xcschemes/Install pEpMacOSAdapter Service.xcscheme View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "NO"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "35380AC5247BBB03004A08A6"
BuildableName = "libdownloadclient.a"
BlueprintName = "downloadclient"
ReferencedContainer = "container:../downloadclient/downloadclient.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "18F3BFD61A81E06E00692297"
BuildableName = "libCocoaLumberjack.a"
BlueprintName = "CocoaLumberjack-Static"
ReferencedContainer = "container:../CocoaLumberjack/Lumberjack.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "15B220002603B04E0097927A"
BuildableName = "libPEPToolbox_macOS.a"
BlueprintName = "PEPToolbox_macOS"
ReferencedContainer = "container:../pep-toolbox/pEpIOSToolbox.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1552D93A2576602D00A92F71"
BuildableName = "libPEPObjCAdapter_macOS.a"
BlueprintName = "PEPObjCAdapter_macOS"
ReferencedContainer = "container:../pEpObjCAdapter/pEpObjCAdapter.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4ED6F72425D2ECE5008BCE79"
BuildableName = "libPEPObjCAdapterXPCService.a"
BlueprintName = "PEPObjCAdapterXPCService"
ReferencedContainer = "container:Subprojects/PEPObjCAdapterXPCService/PEPObjCAdapterXPCService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4E797B9225D523FD0090F900"
BuildableName = "libPEPUpdatesXPCService.a"
BlueprintName = "PEPUpdatesXPCService"
ReferencedContainer = "container:Subprojects/PEPUpdatesXPCService/PEPUpdatesXPCService.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4E44A4C226247559001F9D55"
BuildableName = "Install pEpMacOSAdapter Service"
BlueprintName = "Install pEpMacOSAdapter Service"
ReferencedContainer = "container:pEpMacOSAdapter.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4E44A4C226247559001F9D55"
BuildableName = "Install pEpMacOSAdapter Service"
BlueprintName = "Install pEpMacOSAdapter Service"
ReferencedContainer = "container:pEpMacOSAdapter.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

+ 14
- 0
pEpMacOSAdapter.xcodeproj/xcshareddata/xcschemes/pEpMacOSAdapter.xcscheme View File

@ -104,6 +104,20 @@
ReferencedContainer = "container:pEpMacOSAdapter.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4E44A4C226247559001F9D55"
BuildableName = "Install pEpMacOSAdapter Service"
BlueprintName = "Install pEpMacOSAdapter Service"
ReferencedContainer = "container:pEpMacOSAdapter.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction


Loading…
Cancel
Save