Skip to content

Commit

Permalink
Developer ID applications do not have access to ze cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Morris committed Oct 29, 2013
1 parent 940e5b4 commit fea8a2b
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 31 deletions.
5 changes: 5 additions & 0 deletions Classes/Controllers/TXMasterController.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ - (void)awakeFromNib
#endif

[TPCPreferences initPreferences];

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
[TPCPreferencesCloudSync initializeCloudSyncSession];
#endif

[self.mainWindow setMinSize:TPCPreferences.minimumWindowSize];

Expand Down Expand Up @@ -395,7 +398,9 @@ - (void)applicationWillTerminate:(NSNotification *)note

[TPCPreferences saveTimeIntervalSinceApplicationInstall];

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
[TPCPreferencesCloudSync closeCloudSyncSession];
#endif
}

- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag
Expand Down
10 changes: 8 additions & 2 deletions Classes/Dialogs/TDCServerSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,10 @@ - (void)load
self.serverPasswordField.stringValue = self.config.serverPassword;
self.serverPortField.stringValue = [NSString stringWithInteger:self.config.serverPort];

self.excludedFromCloudSyncingCheck.state = self.config.excludedFromCloudSyncing;
#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
self.excludedFromCloudSyncingCheck.state = self.config.excludedFromCloudSyncing;
#endif

self.zncIgnorePlaybackNotificationsCheck.state = self.config.zncIgnorePlaybackNotifications;

self.prefersIPv6Check.state = self.config.connectionPrefersIPv6;
Expand Down Expand Up @@ -401,7 +404,10 @@ - (void)save
self.config.connectionUsesSSL = self.connectionUsesSSLCheck.state;
self.config.serverPassword = self.serverPasswordField.trimmedStringValue;

self.config.excludedFromCloudSyncing = self.excludedFromCloudSyncingCheck.state;
#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
self.config.excludedFromCloudSyncing = self.excludedFromCloudSyncingCheck.state;
#endif

self.config.zncIgnorePlaybackNotifications = self.zncIgnorePlaybackNotificationsCheck.state;

self.config.performPongTimer = self.pongTimerCheck.state;
Expand Down
4 changes: 4 additions & 0 deletions Classes/Headers/IRCClientConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ NSComparisonResult IRCChannelDataSort(IRCChannel *s1, IRCChannel *s2, void *cont
@property (nonatomic, assign) BOOL isTrustedConnection;
@property (nonatomic, assign) BOOL outgoingFloodControl;
@property (nonatomic, assign) BOOL sidebarItemExpanded;

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
@property (nonatomic, assign) BOOL excludedFromCloudSyncing;
#endif

@property (nonatomic, assign) BOOL zncIgnorePlaybackNotifications; /* ZNC Related option. */
@property (nonatomic, assign) NSInteger floodControlDelayTimerInterval;
@property (nonatomic, assign) NSInteger floodControlMaximumMessages;
Expand Down
4 changes: 4 additions & 0 deletions Classes/Headers/TDCServerSheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@
@property (nonatomic, nweak) NSButton *prefersIPv6Check;
@property (nonatomic, nweak) NSButton *pongTimerCheck;
@property (nonatomic, nweak) NSButton *pongTimerDisconnectCheck;

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
@property (nonatomic, nweak) NSButton *excludedFromCloudSyncingCheck;
#endif

@property (nonatomic, nweak) NSButton *zncIgnorePlaybackNotificationsCheck;
@property (nonatomic, nweak) NSComboBox *serverAddressCombo;
@property (nonatomic, nweak) NSPopUpButton *fallbackEncodingButton;
Expand Down
2 changes: 2 additions & 0 deletions Classes/Headers/TPCPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ typedef enum TPCPreferencesKeyReloadAction : NSInteger {

+ (BOOL)giveFocusOnMessageCommand;

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
+ (BOOL)syncPreferencesToTheCloud; /* ZE CLOUD! */
#endif

+ (BOOL)amsgAllConnections;
+ (BOOL)awayAllConnections;
Expand Down
4 changes: 4 additions & 0 deletions Classes/Headers/TPCPreferencesCloudSync.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@

#import "TextualApplication.h"

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT

@interface TPCPreferencesCloudSync : NSObject
+ (void)initializeCloudSyncSession;
+ (void)refreshCloudSyncSession:(BOOL)destroyExistingRemoteKeys;
+ (void)closeCloudSyncSession;
@end

#endif
8 changes: 7 additions & 1 deletion Classes/IRC/IRCClientConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ - (id)init
self.channelList = [NSMutableArray new];
self.ignoreList = [NSMutableArray new];

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
self.excludedFromCloudSyncing = NO;
#endif

self.autoConnect = NO;
self.autoReconnect = NO;
Expand Down Expand Up @@ -238,7 +240,9 @@ - (id)initWithDictionary:(NSDictionary *)dic
self.serverPort = NSDictionaryIntegerKeyValueCompare(dic, @"serverPort", self.serverPort);
self.username = NSDictionaryObjectKeyValueCompare(dic, @"identityUsername", self.username);

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
self.excludedFromCloudSyncing = NSDictionaryBOOLKeyValueCompare(dic, @"excludeFromCloudSyncing", self.excludedFromCloudSyncing);
#endif

self.zncIgnorePlaybackNotifications = NSDictionaryBOOLKeyValueCompare(dic, @"ZNC —> Ignore Playback Buffer Highlights", self.zncIgnorePlaybackNotifications);

Expand Down Expand Up @@ -315,8 +319,10 @@ - (NSMutableDictionary *)dictionaryValue
[dic setInteger:self.proxyType forKey:@"proxyServerType"];
[dic setInteger:self.serverPort forKey:@"serverPort"];

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
[dic setBool:self.excludedFromCloudSyncing forKey:@"excludeFromCloudSyncing"];

#endif

[dic setBool:self.autoConnect forKey:@"connectOnLaunch"];
[dic setBool:self.autoReconnect forKey:@"connectOnDisconnect"];
[dic setBool:self.autoSleepModeDisconnect forKey:@"disconnectOnSleepMode"];
Expand Down
29 changes: 17 additions & 12 deletions Classes/Preferences/TPCPreferences.m
Original file line number Diff line number Diff line change
Expand Up @@ -869,10 +869,12 @@ + (BOOL)displayServerMOTD
return [RZUserDefaults() boolForKey:@"DisplayServerMessageOfTheDayOnConnect"];
}

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
+ (BOOL)syncPreferencesToTheCloud
{
return [RZUserDefaults() boolForKey:@"SyncPreferencesToTheCloud"];
}
#endif

+ (BOOL)copyOnSelect
{
Expand Down Expand Up @@ -1633,28 +1635,31 @@ + (void)initPreferences

NSMutableDictionary *d = [NSMutableDictionary dictionary];

#warning Remember to turn this off by default.
// ------------------------------------------------------------|
#warning Remember to turn this off by default for both builds.

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT
d[@"SyncPreferencesToTheCloud"] = @(NO);
#else
d[@"SyncPreferencesToTheCloud"] = @(YES);
// ------------------------------------------------------------|
#endif

d[@"AutomaticallyAddScrollbackMarker"] = @(YES);
d[@"AutomaticallyDetectHighlightSpam"] = @(YES);
d[@"ChannelNavigationIsServerSpecific"] = @(YES);
d[@"CommandReturnSendsMessageAsAction"] = @(YES);
d[@"ConfirmApplicationQuit"] = @(YES);
d[@"DisplayDockBadges"] = @(YES);
d[@"DisplayDockBadges"] = @(YES);
d[@"DisplayEventInLogView -> Join, Part, Quit"] = @(YES);
d[@"DisplayServerMessageOfTheDayOnConnect"] = @(YES);
d[@"DisplayUserListNoModeSymbol"] = @(YES);
d[@"FocusSelectionOnMessageCommandExecution"] = @(YES);
d[@"LogHighlights"] = @(YES);
d[@"FocusSelectionOnMessageCommandExecution"] = @(YES);
d[@"LogHighlights"] = @(YES);
d[@"LogTranscriptInBatches"] = @(YES);
d[@"PostNotificationsWhileInFocus"] = @(YES);
d[@"ReloadScrollbackOnLaunch"] = @(YES);
d[@"ReplyUnignoredExternalCTCPRequests"] = @(YES);
d[@"TrackNicknameHighlightsOfLocalUser"] = @(YES);
d[@"WebKitDeveloperExtras"] = @(YES);
d[@"ReplyUnignoredExternalCTCPRequests"] = @(YES);
d[@"TrackNicknameHighlightsOfLocalUser"] = @(YES);
d[@"WebKitDeveloperExtras"] = @(YES);

/* Settings for the NSTextView context menu. */
d[@"TextFieldAutomaticSpellCheck"] = @(YES);
Expand All @@ -1672,12 +1677,12 @@ + (void)initPreferences
d[@"NotificationType -> Highlight -> Sound"] = @"Glass";
d[@"NotificationType -> Highlight -> Bounce Dock Icon"] = @(YES);

d[@"NotificationType -> Private Message (New) -> Enabled"] = @(YES);
d[@"NotificationType -> Private Message (New) -> Enabled"] = @(YES);
d[@"NotificationType -> Private Message (New) -> Sound"] = @"Submarine";
d[@"NotificationType -> Private Message (New) -> Bounce Dock Icon"] = @(YES);

d[@"NotificationType -> Private Message -> Enabled"] = @(YES);
d[@"NotificationType -> Private Message -> Sound"] = @"Submarine";
d[@"NotificationType -> Private Message -> Enabled"] = @(YES);
d[@"NotificationType -> Private Message -> Sound"] = @"Submarine";
d[@"NotificationType -> Private Message -> Bounce Dock Icon"] = @(YES);

d[@"NotificationType -> Address Book Match -> Enabled"] = @(YES);
Expand Down
4 changes: 4 additions & 0 deletions Classes/Preferences/TPCPreferencesCloudSync.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

#import "TextualApplication.h"

#ifdef TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT

@implementation TPCPreferencesCloudSync

/* We want to know when we are setting local keys so that
Expand Down Expand Up @@ -251,3 +253,5 @@ + (void)closeCloudSyncSession
}

@end

#endif
25 changes: 21 additions & 4 deletions Main Project (Textual).xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@
4C0E363716F192F200B426C2 /* TVCServerListCellBadge.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0444EC16F15F8200EBB665 /* TVCServerListCellBadge.m */; };
4C17385718197F540099EEC2 /* TPCPreferencesCloudSync.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C17385618197F540099EEC2 /* TPCPreferencesCloudSync.m */; };
4C17385818197F540099EEC2 /* TPCPreferencesCloudSync.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C17385618197F540099EEC2 /* TPCPreferencesCloudSync.m */; };
4C17385E18197F800099EEC2 /* TPCPreferencesCloudSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C17385D18197F800099EEC2 /* TPCPreferencesCloudSync.h */; };
4C17385F18197F800099EEC2 /* TPCPreferencesCloudSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C17385D18197F800099EEC2 /* TPCPreferencesCloudSync.h */; };
4C17385E18197F800099EEC2 /* TPCPreferencesCloudSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C17385D18197F800099EEC2 /* TPCPreferencesCloudSync.h */; settings = {ATTRIBUTES = (Public, ); }; };
4C17385F18197F800099EEC2 /* TPCPreferencesCloudSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C17385D18197F800099EEC2 /* TPCPreferencesCloudSync.h */; settings = {ATTRIBUTES = (Public, ); }; };
4C1893EC17980F060091D173 /* TVCImageURLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1893EB17980F060091D173 /* TVCImageURLoader.m */; };
4C1893ED17980F060091D173 /* TVCImageURLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1893EB17980F060091D173 /* TVCImageURLoader.m */; };
4C1893F317980F460091D173 /* TVCImageURLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C1893F217980F460091D173 /* TVCImageURLoader.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -1332,6 +1332,9 @@
4C92FECA17A8C8F2003888F4 /* TPCResourceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCResourceManager.h; sourceTree = "<group>"; };
4C937BD4170618940050CEF3 /* TLOSpeechSynthesizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TLOSpeechSynthesizer.m; path = Library/TLOSpeechSynthesizer.m; sourceTree = "<group>"; };
4C937BDA170618A80050CEF3 /* TLOSpeechSynthesizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TLOSpeechSynthesizer.h; sourceTree = "<group>"; };
4C994BAB181FB3E0002FECA6 /* Auxiliary.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = Auxiliary.entitlements; path = Resources/Sandbox/Exceptions/Auxiliary.entitlements; sourceTree = SOURCE_ROOT; };
4C994BAC181FB3E0002FECA6 /* Textual.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = Textual.entitlements; path = Resources/Sandbox/Exceptions/Textual.entitlements; sourceTree = SOURCE_ROOT; };
4C994BAD181FB3E0002FECA6 /* TextualWithoutCloud.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = TextualWithoutCloud.entitlements; path = Resources/Sandbox/Exceptions/TextualWithoutCloud.entitlements; sourceTree = SOURCE_ROOT; };
4CA899A6174021FD001176C8 /* TPWTB_Alerts_NC.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TPWTB_Alerts_NC.tif; sourceTree = "<group>"; };
4CA899A7174021FD001176C8 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "[email protected]"; sourceTree = "<group>"; };
4CB125781783DC6600D0214E /* channelRoomStatusIcon_Aqua.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = channelRoomStatusIcon_Aqua.tif; path = "Resources/Images/Status Badges/channelRoomStatusIcon_Aqua.tif"; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -1880,6 +1883,16 @@
name = Dialogs;
sourceTree = "<group>";
};
4C86B4A8181FB40A0043C544 /* Entitlements */ = {
isa = PBXGroup;
children = (
4C994BAB181FB3E0002FECA6 /* Auxiliary.entitlements */,
4C994BAC181FB3E0002FECA6 /* Textual.entitlements */,
4C994BAD181FB3E0002FECA6 /* TextualWithoutCloud.entitlements */,
);
name = Entitlements;
sourceTree = "<group>";
};
4C8AF50F158E99520026668C /* Controllers */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2322,6 +2335,7 @@
isa = PBXGroup;
children = (
4CD6202E16E31EE600D780D6 /* Configurations */,
4C86B4A8181FB40A0043C544 /* Entitlements */,
4CCC6B47158E8C27003A102B /* Info.plist */,
4CC70202171E1CB400BDFAE0 /* BuildConfig.h */,
);
Expand Down Expand Up @@ -2503,7 +2517,6 @@
4C5BA40016F1302F00A96CA2 /* IRCClientConfig.h in Headers */,
4C5BA40116F1302F00A96CA2 /* IRCColorFormat.h in Headers */,
4C5BA40216F1302F00A96CA2 /* IRCConnection.h in Headers */,
4C17385F18197F800099EEC2 /* TPCPreferencesCloudSync.h in Headers */,
4C5BA40316F1302F00A96CA2 /* IRCExtras.h in Headers */,
4C5BA40416F1302F00A96CA2 /* IRCISupportInfo.h in Headers */,
4C5BA40516F1302F00A96CA2 /* IRCMessage.h in Headers */,
Expand Down Expand Up @@ -2602,6 +2615,7 @@
4C92FECC17A8C8F2003888F4 /* TPCResourceManager.h in Headers */,
4C3E729817C39DD7008F2B08 /* THOUnicodeHelper.h in Headers */,
4C529E1F17AEFE44009BA0B3 /* NSDataHelper.h in Headers */,
4C17385F18197F800099EEC2 /* TPCPreferencesCloudSync.h in Headers */,
4C6D464E180830E60098BA12 /* NSMenuHelper.h in Headers */,
4C0C720E1742C444000F82C4 /* NSByteCountFormatterHelper.h in Headers */,
4CC70204171E1CB400BDFAE0 /* BuildConfig.h in Headers */,
Expand Down Expand Up @@ -2651,7 +2665,6 @@
4C8AF62E158E99520026668C /* IRCClientConfig.h in Headers */,
4C8AF62F158E99520026668C /* IRCColorFormat.h in Headers */,
4C8AF630158E99520026668C /* IRCConnection.h in Headers */,
4C17385E18197F800099EEC2 /* TPCPreferencesCloudSync.h in Headers */,
4C8AF631158E99520026668C /* IRCExtras.h in Headers */,
4C8AF632158E99520026668C /* IRCISupportInfo.h in Headers */,
4C8AF633158E99520026668C /* IRCMessage.h in Headers */,
Expand Down Expand Up @@ -2748,6 +2761,7 @@
4C1893F317980F460091D173 /* TVCImageURLoader.h in Headers */,
4C5798BA179B451400968800 /* TVCMemberListCellBadge.h in Headers */,
4C529E1E17AEFE44009BA0B3 /* NSDataHelper.h in Headers */,
4C17385E18197F800099EEC2 /* TPCPreferencesCloudSync.h in Headers */,
4C3E729717C39DD7008F2B08 /* THOUnicodeHelper.h in Headers */,
4C92FECB17A8C8F2003888F4 /* TPCResourceManager.h in Headers */,
4C6D464D180830E60098BA12 /* NSMenuHelper.h in Headers */,
Expand Down Expand Up @@ -2821,6 +2835,9 @@
4C1DC5511580420500A47BC9 = {
DevelopmentTeam = 8482Q6EPL6;
SystemCapabilities = {
com.apple.Keychain = {
enabled = 1;
};
com.apple.iCloud = {
enabled = 1;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#include "Shared Developer ID Release Configuration.xcconfig"

CODE_SIGN_IDENTITY = 3rd Party Mac Developer Application
OTHER_CODE_SIGN_FLAGS = --deep
CODE_SIGN_ENTITLEMENTS = Resources/Sandbox/Exceptions/Textual.entitlements

PROVISIONING_PROFILE = 283A199D-AEB0-45B8-8037-17E644E30092

GCC_PREPROCESSOR_DEFINITIONS = TEXTUAL_BUILT_WITH_ICLOUD_SUPPORT=1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SYMROOT = Build Results
ONLY_ACTIVE_ARCH = NO
OBJROOT = ${SRCROOT}/.tmp/SharedBuildResults
SHARED_PRECOMPS_DIR = ${SRCROOT}/.tmp/SharedPCH
CODE_SIGN_ENTITLEMENTS = Resources/Sandbox/Exceptions/Textual.entitlements
CODE_SIGN_ENTITLEMENTS = Resources/Sandbox/Exceptions/TextualWithoutCloud.entitlements
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
MACOSX_DEPLOYMENT_TARGET = 10.7
LD_NO_PIE = YES
Expand Down
17 changes: 6 additions & 11 deletions Resources/Sandbox/Exceptions/Textual.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>8482Q6EPL6.com.codeux.irc.textual</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>8482Q6EPL6.com.codeux.irc.textual</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
Expand All @@ -10,16 +16,5 @@
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.apple.itunes</string>
<string>com.apple.safari</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>8482Q6EPL6.com.codeux.irc.textual</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>8482Q6EPL6.com.codeux.irc.textual</string>
</dict>
</plist>
14 changes: 14 additions & 0 deletions Resources/Sandbox/Exceptions/TextualWithoutCloud.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

0 comments on commit fea8a2b

Please sign in to comment.