Changeset 3148

Show
Ignore:
Timestamp:
03/04/06 16:12:24 (2 years ago)
Author:
timothy
Message:

Properly call _didNotConnect. This prevents the Dis Disconnect notification from being called if we were never connected.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cocoa-networking/Chat Core/MVChatConnection.m

    r3144 r3148  
    775775 
    776776- (void) _willConnect { 
     777        id old = _lastError; 
     778        _lastError = nil; 
     779        [old release]; 
     780 
    777781        _nextAltNickIndex = 0; 
    778782        _status = MVChatConnectionConnectingStatus; 
  • branches/cocoa-networking/Chat Core/MVIRCChatConnection.m

    r3145 r3148  
    648648- (void) socket:(AsyncSocket *) sock willDisconnectWithError:(NSError *) error { 
    649649        NSLog(@"willDisconnectWithError: %@", error ); 
    650         _status = MVChatConnectionServerDisconnectedStatus; 
     650        id old = _lastError; 
     651        _lastError = [error retain]; 
     652        [old release]; 
    651653} 
    652654 
     
    683685        _periodicCleanUpTimer = nil; 
    684686 
    685         [self performSelectorOnMainThread:@selector( _didDisconnect ) withObject:nil waitUntilDone:NO]; 
     687        if( _status == MVChatConnectionConnectingStatus ) 
     688                [self performSelectorOnMainThread:@selector( _didNotConnect ) withObject:nil waitUntilDone:NO]; 
     689 
     690        if( _lastError ) 
     691                _status = MVChatConnectionServerDisconnectedStatus; 
     692 
     693        if( _status == MVChatConnectionServerDisconnectedStatus || _status == MVChatConnectionConnectedStatus ) 
     694                [self performSelectorOnMainThread:@selector( _didDisconnect ) withObject:nil waitUntilDone:NO]; 
    686695} 
    687696