Changeset 2368

Show
Ignore:
Timestamp:
02/23/05 18:11:38 (4 years ago)
Author:
timothy
Message:

Fixes a notification registration problem that would cause growl notifications (among other things) to re repeated by the the number of bookmarks you have plus 1. This fixes the SILC crash that recently popped up. Fixes bugs {2} and {3}.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/MVConnectionsController.m

    r2363 r2368  
    158158        [[self window] setHidesOnDeactivate:NO]; 
    159159        [[self window] setResizeIncrements:NSMakeSize( 1, [connections rowHeight] + [connections intercellSpacing].height - 1. )]; 
    160  
    161         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( windowWillClose: ) name:NSWindowWillCloseNotification object:[self window]]; 
    162160 
    163161        theColumn = [connections tableColumnWithIdentifier:@"auto"]; 
     
    12751273 
    12761274- (void) _registerNotificationsForConnection:(MVChatConnection *) connection { 
    1277         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionWillConnectNotification object:nil]; 
    1278         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionDidConnectNotification object:nil]; 
    1279         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionDidNotConnectNotification object:nil]; 
    1280         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionDidDisconnectNotification object:nil]; 
    1281         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionNicknameAcceptedNotification object:nil]; 
    1282  
    1283         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _willConnect: ) name:MVChatConnectionWillConnectNotification object:nil]; 
    1284         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _didConnect: ) name:MVChatConnectionDidConnectNotification object:nil]; 
    1285         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _didDisconnect: ) name:MVChatConnectionDidDisconnectNotification object:nil]; 
    1286         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _errorOccurred : ) name:MVChatConnectionErrorNotification object:nil]; 
    1287  
    1288         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _requestPassword: ) name:MVChatConnectionNeedNicknamePasswordNotification object:nil]; 
    1289         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _requestCertificatePassword: ) name:MVChatConnectionNeedCertificatePasswordNotification object:nil]; 
    1290         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _requestPublicKeyVerification: ) name:MVChatConnectionNeedPublicKeyVerificationNotification object:nil];    
     1275        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionWillConnectNotification object:connection]; 
     1276        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionDidConnectNotification object:connection]; 
     1277        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionDidNotConnectNotification object:connection]; 
     1278        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionDidDisconnectNotification object:connection]; 
     1279        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refresh: ) name:MVChatConnectionNicknameAcceptedNotification object:connection]; 
     1280 
     1281        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _willConnect: ) name:MVChatConnectionWillConnectNotification object:connection]; 
     1282        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _didConnect: ) name:MVChatConnectionDidConnectNotification object:connection]; 
     1283        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _didDisconnect: ) name:MVChatConnectionDidDisconnectNotification object:connection]; 
     1284        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _errorOccurred : ) name:MVChatConnectionErrorNotification object:connection]; 
     1285 
     1286        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _requestPassword: ) name:MVChatConnectionNeedNicknamePasswordNotification object:connection]; 
     1287        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _requestCertificatePassword: ) name:MVChatConnectionNeedCertificatePasswordNotification object:connection]; 
     1288        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _requestPublicKeyVerification: ) name:MVChatConnectionNeedPublicKeyVerificationNotification object:connection];     
    12911289} 
    12921290 
     
    14291427        NSMutableDictionary *info = nil; 
    14301428 
    1431         [self _registerNotificationsForConnection:nil]; // deregister all connections 
     1429        [self _deregisterNotificationsForConnection:nil]; // deregister all connections 
    14321430 
    14331431        while( ( info = [enumerator nextObject] ) ) { 
     
    16021600 
    16031601        if ( [publicKeyVerification isVisible] ) { 
    1604 //              FIX!: queuing the notifications from the same seems to crash us if SILC keeps asking us to verify. 
    1605 //              The SILC server koopanet.cjb.net port 706 makes this happen. So this is commented out 
    1606 //              until further investigation. 
    1607  
    1608 //              [_publicKeyRequestQueue addObject:notification]; 
     1602                [_publicKeyRequestQueue addObject:notification]; 
    16091603                return; 
    16101604        }