diff --git a/Classes/Dialogs/ServerDialog.h b/Classes/Dialogs/ServerDialog.h index c97af28a..38abe708 100644 --- a/Classes/Dialogs/ServerDialog.h +++ b/Classes/Dialogs/ServerDialog.h @@ -31,6 +31,7 @@ @property (nonatomic) IBOutlet NSTextField* nickPasswordText; @property (nonatomic) IBOutlet NSButton* saslCheck; @property (nonatomic) IBOutlet NSTextField* altNicksText; +@property (nonatomic) IBOutlet NSTextField* timeoutText; @property (nonatomic) IBOutlet NSTextField* leavingCommentText; @property (nonatomic) IBOutlet NSTextField* userInfoText; diff --git a/Classes/Dialogs/ServerDialog.m b/Classes/Dialogs/ServerDialog.m index 13e30568..558497c8 100644 --- a/Classes/Dialogs/ServerDialog.m +++ b/Classes/Dialogs/ServerDialog.m @@ -92,7 +92,9 @@ - (void)load _usernameText.stringValue = _config.username; _realNameText.stringValue = _config.realName; _nickPasswordText.stringValue = _config.nickPassword; + _timeoutText.intValue = _config.timeout; _saslCheck.state = _config.useSASL; + if (_config.altNicks.count) { _altNicksText.stringValue = [_config.altNicks componentsJoinedByString:@" "]; } @@ -130,6 +132,7 @@ - (void)save _config.username = _usernameText.stringValue; _config.realName = _realNameText.stringValue; _config.nickPassword = _nickPasswordText.stringValue; + _config.timeout = _timeoutText.intValue; _config.useSASL = _saslCheck.state; NSArray* nicks = [_altNicksText.stringValue componentsSeparatedByString:@" "]; @@ -170,6 +173,7 @@ - (void)updateConnectionPage int port = [_portText intValue]; NSString* nick = [_nickText stringValue]; NSString* nickPassword = [_nickPasswordText stringValue]; + int timeout = [_timeoutText intValue]; BOOL enabled = name.length && host.length && ![host isEqualToString:@"-"] && port > 0 && nick.length; [_okButton setEnabled:enabled]; diff --git a/Classes/IRC/IRCClient.m b/Classes/IRC/IRCClient.m index 92d7aedc..364e7d33 100644 --- a/Classes/IRC/IRCClient.m +++ b/Classes/IRC/IRCClient.m @@ -22,7 +22,6 @@ #define QUIT_INTERVAL 5 #define RECONNECT_INTERVAL 20 #define RETRY_INTERVAL 240 -#define NICKSERV_INTERVAL 5 #define CTCP_MIN_INTERVAL 5 @@ -428,7 +427,7 @@ - (void)onRetryTimer:(id)sender - (void)startAutoJoinTimer { [_autoJoinTimer stop]; - [_autoJoinTimer start:NICKSERV_INTERVAL]; + [_autoJoinTimer start:_config.timeout]; } - (void)stopAutoJoinTimer diff --git a/Classes/IRC/IRCClientConfig.h b/Classes/IRC/IRCClientConfig.h index 90197e17..1ac50aa1 100644 --- a/Classes/IRC/IRCClientConfig.h +++ b/Classes/IRC/IRCClientConfig.h @@ -25,6 +25,7 @@ typedef enum { @property (nonatomic) NSString* username; @property (nonatomic) NSString* realName; @property (nonatomic) NSString* nickPassword; +@property (nonatomic) int timeout; @property (nonatomic) BOOL useSASL; @property (nonatomic, readonly) NSMutableArray* altNicks; diff --git a/Classes/IRC/IRCClientConfig.m b/Classes/IRC/IRCClientConfig.m index b4cbec0a..8cea3765 100644 --- a/Classes/IRC/IRCClientConfig.m +++ b/Classes/IRC/IRCClientConfig.m @@ -35,6 +35,7 @@ - (id)init _username = @""; _realName = @""; _nickPassword = @""; + _timeout = 15; _proxyHost = @""; _proxyPort = 1080; @@ -70,6 +71,7 @@ - (id)initWithDictionary:(NSDictionary*)dic _username = [dic stringForKey:@"username"] ?: @""; _realName = [dic stringForKey:@"realname"] ?: @""; _nickPassword = [dic stringForKey:@"nickPassword"] ?: [Keychain genericPasswordWithAccountName:[self nickPassword] serviceName:[self keychainServiceName]] ?: @""; + _timeout = [dic intForKey:@"timeout"] ?: 15; _useSASL = [dic boolForKey:@"useSASL"]; [_altNicks addObjectsFromArray:[dic arrayForKey:@"alt_nicks"]]; @@ -132,6 +134,7 @@ - (NSMutableDictionary*)dictionaryValue } else if (_nickPassword) { [dic setObject:_nickPassword forKey:@"nickPassword"]; } + [dic setInt:_timeout forKey:@"timeout"]; [dic setBool:_useSASL forKey:@"useSASL"]; if (_altNicks) [dic setObject:_altNicks forKey:@"alt_nicks"]; diff --git a/English.lproj/ServerDialog.xib b/English.lproj/ServerDialog.xib index 25b791f1..209ab556 100644 --- a/English.lproj/ServerDialog.xib +++ b/English.lproj/ServerDialog.xib @@ -1,8 +1,8 @@ - + - + @@ -38,6 +38,7 @@ + @@ -45,28 +46,28 @@ - + - + - + - + - + - + @@ -75,7 +76,7 @@ - + @@ -83,8 +84,23 @@ + + + + + + + + - + @@ -93,7 +109,7 @@ - + @@ -105,8 +121,17 @@ + + + + + + + + + - + @@ -120,17 +145,25 @@ - - + + + - + - + @@ -138,17 +171,24 @@ - - + + - + + + + + + + + - + @@ -159,17 +199,17 @@ - - + + - + - + @@ -177,17 +217,17 @@ - - + + - + - + @@ -195,17 +235,17 @@ - - + + - + - + @@ -216,39 +256,40 @@ - - - - - - - - - - + + - - - - - - + + + + + + + + - + + + NSAllRomanInputSourcesLocaleIdentifier + + + + - + @@ -256,50 +297,34 @@ - - + + - - - - + + + + - - - + + - - + + - - + - + @@ -308,7 +333,7 @@ - + @@ -317,7 +342,7 @@ - + @@ -326,7 +351,7 @@ - + @@ -401,7 +426,7 @@ - + @@ -410,7 +435,7 @@ - + @@ -479,14 +504,14 @@ - + - + @@ -495,14 +520,14 @@ - + - + @@ -511,7 +536,7 @@ - + @@ -520,7 +545,7 @@ - + @@ -529,7 +554,7 @@ - + @@ -538,7 +563,7 @@ - + @@ -547,7 +572,7 @@ - + @@ -556,7 +581,7 @@ - + @@ -565,7 +590,7 @@ - + @@ -574,7 +599,7 @@ - + @@ -586,7 +611,7 @@ - + @@ -595,7 +620,7 @@ - + @@ -604,7 +629,7 @@ - + @@ -630,11 +655,11 @@ - + - + @@ -708,7 +733,7 @@ - + @@ -745,7 +770,7 @@ - + @@ -754,7 +779,7 @@