Changeset 3642

Show
Ignore:
Timestamp:
01/28/06 10:27:06 (3 years ago)
Author:
morris
Message:

Implement WCNickDidChange, WCStatusDidChange and WCIconDidChange again

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCChat.m

    r3638 r3642  
    10571057        else if(selector == @selector(insertTab:)) { 
    10581058                if([WCSettings boolForKey:WCTabCompleteNicks]) { 
    1059                         NSArray                 *nicks; 
    1060                         NSString                *p, *prefix; 
    1061                         int                             i, count, options; 
    1062  
    10631059                        [_chatInputTextView setString:[self _completeString:[_chatInputTextView string]]]; 
    10641060                         
  • WiredClient/trunk/WCServerConnection.m

    r3596 r3642  
    3737#import "WCMessages.h" 
    3838#import "WCNews.h" 
     39#import "WCPreferences.h" 
    3940#import "WCPublicChat.h" 
    4041#import "WCSearch.h" 
     
    7071         
    7172        [self window]; 
     73 
     74        [[NSNotificationCenter defaultCenter] 
     75                addObserver:self 
     76                   selector:@selector(nickDidChange:) 
     77                           name:WCNickDidChange]; 
     78 
     79        [[NSNotificationCenter defaultCenter] 
     80                addObserver:self 
     81                   selector:@selector(statusDidChange:) 
     82                           name:WCStatusDidChange]; 
     83 
     84        [[NSNotificationCenter defaultCenter] 
     85                addObserver:self 
     86                   selector:@selector(iconDidChange:) 
     87                           name:WCIconDidChange]; 
    7288 
    7389        [self addObserver:self 
     
    268284 
    269285 
     286- (void)nickDidChange:(NSNotification *)notification { 
     287        NSString        *nick; 
     288         
     289        nick = [_bookmark objectForKey:WCBookmarksNick]; 
     290         
     291        if([nick length] == 0) 
     292                nick = [WCSettings objectForKey:WCNick]; 
     293 
     294        [_link sendCommand:WCNickCommand withArgument:nick]; 
     295} 
     296 
     297 
     298 
     299- (void)statusDidChange:(NSNotification *)notification { 
     300        NSString        *status; 
     301         
     302        if([_server protocol] >= 1.1) { 
     303                status = [_bookmark objectForKey:WCBookmarksStatus]; 
     304                 
     305                if([status length] == 0) 
     306                        status = [WCSettings objectForKey:WCStatus]; 
     307                 
     308                [_link sendCommand:WCStatusCommand withArgument:status]; 
     309        } 
     310} 
     311 
     312 
     313 
     314- (void)iconDidChange:(NSNotification *)notification { 
     315        if([_server protocol] >= 1.1) { 
     316                [_link sendCommand:WCIconCommand 
     317                         withArgument:@"0" 
     318                         withArgument:[WCSettings objectForKey:WCCustomIcon]]; 
     319        } 
     320} 
     321 
     322 
     323 
    270324- (void)connectionDidConnect:(NSNotification *)notification { 
    271325        [_link sendCommand:WCHelloCommand]; 
  • WiredClient/trunk/WiredClient.xcodeproj/project.pbxproj

    r3620 r3642  
    14041404                                A57512EC05E4E64D003B51D7 /* WCCache.m in Sources */, 
    14051405                                A5DC7F25057AAFE100736BBF /* WCChat.m in Sources */, 
     1406                                777D3F6609890273005B5EC1 /* WCChatWindow.m in Sources */, 
    14061407                                A5A338FE0720483C00A16E9A /* WCConnectionController.m in Sources */, 
    14071408                                A5DC7EE5057AAF2900736BBF /* WCConsole.m in Sources */, 
     
    14381439                                A5DC7F84057AB05F00736BBF /* WCUserCell.m in Sources */, 
    14391440                                A5DC7F09057AAF6C00736BBF /* WCUserInfo.m in Sources */, 
    1440                                 777D3F6609890273005B5EC1 /* WCChatWindow.m in Sources */, 
    14411441                        ); 
    14421442                        runOnlyForDeploymentPostprocessing = 0;