Changeset 1296

Show
Ignore:
Timestamp:
05/21/04 22:26:44 (5 years ago)
Author:
morris
Message:

pre-1.2 servers do not follow spec and send host

Files:

Legend:

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

    r1295 r1296  
    1 /* $Id: WCChat.m,v 1.42 2004/05/21 19:32:03 morris Exp $ */ 
     1/* $Id: WCChat.m,v 1.43 2004/05/21 20:26:44 morris Exp $ */ 
    22 
    33/* 
     
    323323 
    324324- (void)userHasJoined:(NSNotification *)notification { 
    325         NSString                *argument, *cid, *uid, *idle, *admin, *icon, *nick, *login, *address, *host, *status = NULL, *image = NULL; 
     325        NSString                *argument, *cid, *uid, *idle, *admin, *icon, *nick, *login, *address, *host = NULL, *status = NULL, *image = NULL; 
    326326        NSArray                 *fields; 
    327327        NSData                  *data; 
     
    347347        login   = [fields objectAtIndex:6]; 
    348348        address = [fields objectAtIndex:7]; 
    349         host    = [fields objectAtIndex:8]; 
    350          
     349         
     350        // --- pre-1.2 servers did not send this 
     351        if([fields count] >= 9) 
     352                host    = [fields objectAtIndex:8]; 
     353 
    351354        // --- protocol 1.1 
    352355        if([_connection protocol] >= 1.1) { 
     
    367370        [user setLogin:login]; 
    368371        [user setAddress:address]; 
    369         [user setHost:host]; 
    370372        [user setJoinTime:[NSDate date]]; 
     373 
     374        // --- pre-1.2 servers did not send this 
     375        if([fields count] >= 9) 
     376                [user setHost:host]; 
    371377         
    372378        // --- protocol 1.1 
    373379        if([_connection protocol] >= 1.1) { 
    374                 // --- set status 
     380                // --- set values 
     381                [user setHost:host]; 
    375382                [user setStatus:status]; 
    376383