Changeset 3790

Show
Ignore:
Timestamp:
07/14/08 02:52:03 (4 months ago)
Author:
timothy
Message:

Stop using NSHost. Just use strings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Chat Core/MVDirectChatConnection.h

    r3722 r3790  
    2626        MVChatMessageFormat _outgoingChatFormat; 
    2727        NSStringEncoding _encoding; 
    28         NSHost *_host; 
    29         NSHost *_connectedHost; 
     28        NSString *_host; 
     29        NSString *_connectedHost; 
    3030        BOOL _passive; 
    3131        BOOL _localRequest; 
     
    4444 
    4545- (MVChatUser *) user; 
    46 - (NSHost *) host; 
    47 - (NSHost *) connectedHost; 
     46- (NSString *) host; 
     47- (NSString *) connectedHost; 
    4848- (unsigned short) port; 
    4949 
  • trunk/Chat Core/MVDirectChatConnection.m

    r3722 r3790  
    9797} 
    9898 
    99 - (NSHost *) host { 
     99- (NSString *) host { 
    100100        return _host; 
    101101} 
    102102 
    103 - (NSHost *) connectedHost { 
     103- (NSString *) connectedHost { 
    104104        return _connectedHost; 
    105105} 
     
    123123        if( _localRequest ) { 
    124124                if( ! [self isPassive] ) [_directClientConnection acceptConnectionOnFirstPortInRange:[MVFileTransfer fileTransferPortRange]]; 
    125                 else [_directClientConnection connectToHost:[[self host] address] onPort:[self port]]; 
     125                else [_directClientConnection connectToHost:[self host] onPort:[self port]]; 
    126126        } else { 
    127127                if( [self isPassive] ) [_directClientConnection acceptConnectionOnFirstPortInRange:[MVFileTransfer fileTransferPortRange]]; 
    128                 else [_directClientConnection connectToHost:[[self host] address] onPort:[self port]]; 
     128                else [_directClientConnection connectToHost:[self host] onPort:[self port]]; 
    129129        } 
    130130} 
     
    219219        [self _setStatus:MVDirectChatConnectionConnectedStatus]; 
    220220 
    221         MVSafeRetainAssign( &_connectedHost, [NSHost hostWithAddress:host] ); 
     221        MVSafeRetainAssign( &_connectedHost, host ); 
    222222 
    223223        [self _readNextMessage]; 
     
    297297                _outgoingChatFormat = MVChatConnectionDefaultMessageFormat; 
    298298                _user = [chatUser retain]; 
    299                 _host = [[NSHost currentHost] retain]; 
    300299        } 
    301300 
     
    330329} 
    331330 
    332 - (void) _setHost:(NSHost *) newHost { 
     331- (void) _setHost:(NSString *) newHost { 
    333332        MVSafeRetainAssign( &_host, newHost ); 
    334333} 
  • trunk/Chat Core/MVDirectChatConnectionPrivate.h

    r3545 r3790  
    88 
    99- (void) _setStatus:(MVDirectChatConnectionStatus) status; 
    10 - (void) _setHost:(NSHost *) host; 
     10- (void) _setHost:(NSString *) host; 
    1111- (void) _setPort:(unsigned short) port; 
    1212- (void) _setPassive:(BOOL) passive; 
  • trunk/Chat Core/MVFileTransfer.h

    r3778 r3790  
    3131        unsigned long long _transfered; 
    3232        NSDate *_startDate; 
    33         NSHost *_host; 
     33        NSString *_host; 
    3434        BOOL _passive; 
    3535        unsigned short _port; 
     
    5959@property(readonly) unsigned long long startOffset; 
    6060 
    61 @property(readonly) NSHost *host; 
     61@property(readonly) NSString *host; 
    6262@property(readonly) unsigned short port; 
    6363 
     
    7575- (unsigned long long) startOffset; 
    7676 
    77 - (NSHost *) host; 
     77- (NSString *) host; 
    7878- (unsigned short) port; 
    7979 
  • trunk/Chat Core/MVFileTransfer.m

    r3778 r3790  
    122122#pragma mark - 
    123123 
    124 - (NSHost *) host { 
     124- (NSString *) host { 
    125125        return _host; 
    126126} 
     
    167167} 
    168168 
    169 - (void) _setHost:(NSHost *) newHost { 
     169- (void) _setHost:(NSString *) newHost { 
    170170        MVSafeRetainAssign( &_host, newHost ); 
    171171} 
  • trunk/Chat Core/MVFileTransferPrivate.h

    r3150 r3790  
    77- (void) _setStartOffset:(unsigned long long) startOffset; 
    88- (void) _setStartDate:(NSDate *) startDate; 
    9 - (void) _setHost:(NSHost *) host; 
     9- (void) _setHost:(NSString *) host; 
    1010- (void) _setPort:(unsigned short) port; 
    1111- (void) _setPassive:(BOOL) passive; 
  • trunk/Chat Core/MVIRCChatConnection.m

    r3769 r3790  
    18061806 
    18071807                                        if( transfer ) { 
    1808                                                 [transfer _setHost:[NSHost hostWithAddress:address]]; 
     1808                                                [transfer _setHost:address]; 
    18091809                                                [transfer _setPort:port]; 
    18101810                                                [transfer _setupAndStart]; 
     
    18171817                                                [transfer _setPassive:YES]; 
    18181818                                        } else { 
    1819                                                 [transfer _setHost:[NSHost hostWithAddress:address]]; 
     1819                                                [transfer _setHost:address]; 
    18201820                                                [transfer _setPort:port]; 
    18211821                                        } 
     
    19411941 
    19421942                                                if( directChat ) { 
    1943                                                         [directChat _setHost:[NSHost hostWithAddress:address]]; 
     1943                                                        [directChat _setHost:address]; 
    19441944                                                        [directChat _setPort:port]; 
    19451945                                                        [directChat initiate]; 
     
    19521952                                                        [directChatConnection _setPassive:YES]; 
    19531953                                                } else { 
    1954                                                         [directChatConnection _setHost:[NSHost hostWithAddress:address]]; 
     1954                                                        [directChatConnection _setHost:address]; 
    19551955                                                        [directChatConnection _setPort:port]; 
    19561956                                                } 
  • trunk/Chat Core/MVIRCFileTransfer.m

    r3783 r3790  
    183183 
    184184        if( ! [self isPassive] ) [_directClientConnection acceptConnectionOnFirstPortInRange:[[self class] fileTransferPortRange]]; 
    185         else [_directClientConnection connectToHost:[[self host] address] onPort:[self port]]; 
     185        else [_directClientConnection connectToHost:[self host] onPort:[self port]]; 
    186186} 
    187187 
     
    263263                else [[self user] sendSubcodeReply:@"DCC" withArguments:[NSString stringWithFormat:@"REJECT SEND %@ 16843009 0 %llu %lu T", [self originalFileName], [self finalSize], [self _passiveIdentifier]]]; 
    264264        } else { 
    265                 NSString *address = [[self host] address]; 
     265                NSString *address = [self host]; 
    266266                if( ! address ) address = @"16843009"; 
    267267                if( address && [address rangeOfString:@"."].location != NSNotFound ) 
     
    394394 
    395395        if( [self isPassive] ) [_directClientConnection acceptConnectionOnFirstPortInRange:[[self class] fileTransferPortRange]]; 
    396         else [_directClientConnection connectToHost:[[self host] address] onPort:[self port]]; 
     396        else [_directClientConnection connectToHost:[self host] onPort:[self port]]; 
    397397} 
    398398 
  • trunk/Panels/JVDirectChatPanel.m

    r3784 r3790  
    395395 
    396396        if( [[self target] isKindOfClass:[MVDirectChatConnection class]] ) { 
    397                 NSString *host = [[(MVDirectChatConnection *)[self target] connectedHost] name]; 
     397                NSString *host = [(MVDirectChatConnection *)[self target] connectedHost]; 
    398398                if( ! [host length] ) host = [[self user] address]; 
    399399                if( [host length] ) return [NSString stringWithFormat:@"%@ (%@)", [self title], host]; 
     
    413413                        return NSLocalizedString( @"disconnected", "disconnected information" ); 
    414414 
    415                 NSString *host = [[(MVDirectChatConnection *)[self target] connectedHost] name]; 
     415                NSString *host = [(MVDirectChatConnection *)[self target] connectedHost]; 
    416416                if( ! [host length] ) host = [[self user] address]; 
    417417                return host; 
     
    437437                        info = NSLocalizedString( @"disconnected", "disconnected tooltip" ); 
    438438                else { 
    439                         info = [[(MVDirectChatConnection *)[self target] connectedHost] name]; 
     439                        info = [(MVDirectChatConnection *)[self target] connectedHost]; 
    440440                        if( ! [info length] ) info = [[self user] address]; 
    441441                }