Changeset 3111

Show
Ignore:
Timestamp:
01/02/06 00:01:40 (3 years ago)
Author:
timothy
Message:

If the sender for PRIVMSG or NOTICE is a server, then we need to make a user object with the server name. Not an ideal solution, but Colloquy requires these notifications to be from users. The old Irssi Chat Core did this.

Files:

Legend:

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

    r3107 r3111  
    12801280 
    12811281- (void) _handlePrivmsgWithParameters:(NSArray *) parameters fromSender:(MVChatUser *) sender { 
    1282         if( [parameters count] == 2 ) { 
     1282        // if the sender is a server lets make a user for the server name 
     1283        // this is not ideal but the notifications need user objects 
     1284        if( [sender isKindOfClass:[NSString class]] ) 
     1285                sender = [self chatUserWithUniqueIdentifier:(NSString *) sender]; 
     1286 
     1287        if( [parameters count] == 2 && [sender isKindOfClass:[MVChatUser class]] ) { 
    12831288                NSString *targetName = [parameters objectAtIndex:0]; 
    12841289                if( ! [targetName length] ) return; 
     
    13131318 
    13141319- (void) _handleNoticeWithParameters:(NSArray *) parameters fromSender:(MVChatUser *) sender { 
    1315         if( [parameters count] == 2 ) { 
     1320        // if the sender is a server lets make a user for the server name 
     1321        // this is not ideal but the notifications need user objects 
     1322        if( [sender isKindOfClass:[NSString class]] ) 
     1323                sender = [self chatUserWithUniqueIdentifier:(NSString *) sender]; 
     1324 
     1325        if( [parameters count] == 2 && [sender isKindOfClass:[MVChatUser class]] ) { 
    13161326                NSString *targetName = [parameters objectAtIndex:0]; 
    13171327                if( ! [targetName length] ) return;