Changeset 3631

Show
Ignore:
Timestamp:
03/18/07 19:13:13 (2 years ago)
Author:
timothy
Message:

No need to call postNotificationOnMainThreadWithName: in a method that already is on the main thread.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Chat Core/MVIRCChatConnection.m

    r3630 r3631  
    15751575                        if( [msg hasCaseInsensitiveSubstring:@"NickServ"] && [msg hasCaseInsensitiveSubstring:@"IDENTIFY"] ) { 
    15761576                                if( ! [self nicknamePassword] ) { 
    1577                                         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:MVChatConnectionNeedNicknamePasswordNotification object:self userInfo:nil]; 
     1577                                        [[NSNotificationCenter defaultCenter] postNotificationName:MVChatConnectionNeedNicknamePasswordNotification object:self userInfo:nil]; 
    15781578                                } else [self sendRawMessageImmediatelyWithFormat:@"NickServ IDENTIFY %@", [self nicknamePassword]]; 
    15791579                        } else if( [msg hasCaseInsensitiveSubstring:@"password accepted"] ) { 
     
    16611661        } 
    16621662 
    1663         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:( request ? MVChatConnectionSubcodeRequestNotification : MVChatConnectionSubcodeReplyNotification ) object:sender userInfo:[NSDictionary dictionaryWithObjectsAndKeys:command, @"command", arguments, @"arguments", nil]]; 
     1663        [[NSNotificationCenter defaultCenter] postNotificationName:( request ? MVChatConnectionSubcodeRequestNotification : MVChatConnectionSubcodeReplyNotification ) object:sender userInfo:[NSDictionary dictionaryWithObjectsAndKeys:command, @"command", arguments, @"arguments", nil]]; 
    16641664 
    16651665        NSMethodSignature *signature = [NSMethodSignature methodSignatureWithReturnAndArgumentTypes:@encode( BOOL ), @encode( NSString * ), @encode( NSString * ), @encode( MVChatUser * ), nil]; 
     
    17831783                                        [transfer _setFinalSize:(unsigned long long)size]; 
    17841784 
    1785                                         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:MVDownloadFileTransferOfferNotification object:transfer]; 
     1785                                        [[NSNotificationCenter defaultCenter] postNotificationName:MVDownloadFileTransferOfferNotification object:transfer]; 
    17861786 
    17871787                                        [self _addDirectClientConnection:transfer]; 
     
    19131913                                                } 
    19141914 
    1915                                                 [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:MVDirectChatConnectionOfferNotification object:directChatConnection userInfo:[NSDictionary dictionaryWithObjectsAndKeys:sender, @"user", nil]]; 
     1915                                                [[NSNotificationCenter defaultCenter] postNotificationName:MVDirectChatConnectionOfferNotification object:directChatConnection userInfo:[NSDictionary dictionaryWithObjectsAndKeys:sender, @"user", nil]]; 
    19161916 
    19171917                                                [self _addDirectClientConnection:directChatConnection]; 
     
    21092109- (void) _handleTopic:(NSDictionary *)topicInfo { 
    21102110        MVAssertMainThreadRequired(); 
    2111          
     2111 
    21122112        MVChatRoom *room = [topicInfo objectForKey:@"room"]; 
    21132113        MVChatUser *author = [topicInfo objectForKey:@"author"]; 
    21142114        NSMutableData *topic = [[topicInfo objectForKey:@"topic"] mutableCopyWithZone:nil]; 
    2115          
     2115 
    21162116        NSMethodSignature *signature = [NSMethodSignature methodSignatureWithReturnAndArgumentTypes:@encode( void ), @encode( NSMutableData * ), @encode( MVChatRoom * ), @encode( MVChatUser * ), nil]; 
    21172117        NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; 
     
    21202120        [invocation setArgument:&room atIndex:3]; 
    21212121        [invocation setArgument:&author atIndex:4]; 
    2122          
     2122 
    21232123        [[MVChatPluginManager defaultManager] makePluginsPerformInvocation:invocation]; 
    2124          
     2124 
    21252125        [room _setTopic:topic]; 
    21262126        [room _setTopicAuthor:author]; 
    21272127        [room _setTopicDate:[NSDate date]]; 
    2128         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:MVChatRoomTopicChangedNotification object:room userInfo:nil]; 
    2129          
     2128        [[NSNotificationCenter defaultCenter] postNotificationName:MVChatRoomTopicChangedNotification object:room userInfo:nil]; 
     2129 
    21302130        [topic release]; 
    21312131} 
     
    21422142                MVChatRoom *room = [self joinedChatRoomWithName:[parameters objectAtIndex:0]]; 
    21432143                NSData *topic = [parameters objectAtIndex:1]; 
    2144                 if( ! [topic isKindOfClass:[NSData class]] ) topic = [NSData data]
    2145                 [self performSelectorOnMainThread:@selector(_handleTopic:) withObject:[NSDictionary dictionaryWithObjectsAndKeys:room, @"room", topic, @"topic", sender, @"author", nil] waitUntilDone:NO]; 
     2144                if( ! [topic isKindOfClass:[NSData class]] ) topic = nil
     2145                [self performSelectorOnMainThread:@selector( _handleTopic: ) withObject:[NSDictionary dictionaryWithObjectsAndKeys:room, @"room", sender, @"author", topic, @"topic", nil] waitUntilDone:NO]; 
    21462146        } 
    21472147}