Skip to content

Commit

Permalink
Don't use SASL when NickServ password is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
psychs committed May 6, 2014
1 parent f84ccbc commit 9aba935
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Classes/Dialogs/ServerDialog.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ - (void)save
_config.username = _usernameText.stringValue;
_config.realName = _realNameText.stringValue;
_config.nickPassword = _nickPasswordText.stringValue;
_config.useSASL = _saslCheck.state;
if (_config.nickPassword.length > 0) {
_config.useSASL = _saslCheck.state;
}
else {
_config.useSASL = NO;
}

NSArray* nicks = [_altNicksText.stringValue componentsSeparatedByString:@" "];
[_config.altNicks removeAllObjects];
Expand Down
4 changes: 3 additions & 1 deletion Classes/IRC/IRCClientConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ - (id)initWithDictionary:(NSDictionary*)dic
_username = [dic stringForKey:@"username"] ?: @"";
_realName = [dic stringForKey:@"realname"] ?: @"";
_nickPassword = [dic stringForKey:@"nickPassword"] ?: [Keychain genericPasswordWithAccountName:[self nickPasswordKey] serviceName:[self keychainServiceName]] ?: @"";
_useSASL = [dic boolForKey:@"useSASL"];
if (_nickPassword.length > 0) {
_useSASL = [dic boolForKey:@"useSASL"];
}
[_altNicks addObjectsFromArray:[dic arrayForKey:@"alt_nicks"]];

_proxyType = [dic intForKey:@"proxy"];
Expand Down

0 comments on commit 9aba935

Please sign in to comment.