Changeset 3717
- Timestamp:
- 08/29/07 01:47:02 (1 year ago)
- Files:
-
- trunk/Controllers/MVConnectionsController.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Controllers/MVConnectionsController.m
r3637 r3717 601 601 602 602 - (MVChatConnection *) connectionForServerAddress:(NSString *) address { 603 NSEnumerator *enumerator = [_bookmarks objectEnumerator]; 604 id info = nil; 605 606 address = [address stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@". \t\n"]]; 607 608 while( ( info = [enumerator nextObject] ) ) { 609 MVChatConnection *connection = [info objectForKey:@"connection"]; 610 NSString *server = [connection server]; 611 NSRange range = [server rangeOfString:address options:( NSCaseInsensitiveSearch | NSLiteralSearch | NSBackwardsSearch | NSAnchoredSearch ) range:NSMakeRange( 0, [server length] )]; 612 if( range.location != NSNotFound && ( range.location == 0 || [server characterAtIndex:( range.location - 1 )] == '.' ) ) 613 return connection; 614 } 615 603 NSArray *result = [self connectionsForServerAddress:address]; 604 if( [result count] ) 605 return [result objectAtIndex:0]; 616 606 return nil; 617 607 } … … 730 720 [quitMessageString release]; 731 721 732 [self _deregisterNotificationsForConnection: connection];722 [self _deregisterNotificationsForConnection:oldConnection]; 733 723 734 724 [[MVKeyChain defaultKeyChain] setInternetPassword:nil forServer:[oldConnection server] securityDomain:[oldConnection server] account:[oldConnection nickname] path:nil port:0 protocol:MVKeyChainProtocolIRC authenticationType:MVKeyChainAuthenticationTypeDefault]; … … 736 726 737 727 [oldConnection release]; 728 729 [self _registerNotificationsForConnection:connection]; 738 730 739 731 [_bookmarks replaceObjectAtIndex:index withObject:info];
