Changeset 3726

Show
Ignore:
Timestamp:
09/13/07 02:02:26 (1 year ago)
Author:
timothy
Message:

Allow the room part reason to contain colors and formatting.

Files:

Legend:

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

    r3722 r3726  
    3737- (void) partWithReason:(MVChatString *) reason { 
    3838        if( ! [self isJoined] ) return; 
    39         if( ! [reason length] ) [[self connection] sendRawMessageImmediatelyWithFormat:@"PART %@", [self name]]; 
    40         else [[self connection] sendRawMessageImmediatelyWithFormat:@"PART %@ :%@", [self name], [reason string]]; 
     39 
     40        if( [reason length] ) { 
     41                NSData *reasonData = [MVIRCChatConnection _flattenedIRCDataForMessage:reason withEncoding:[self encoding] andChatFormat:[[self connection] outgoingChatFormat]]; 
     42                NSString *prefix = [[NSString allocWithZone:nil] initWithFormat:@"PART %@ :", [self name]]; 
     43                [[self connection] sendRawMessageWithComponents:prefix, reasonData, nil]; 
     44                [prefix release]; 
     45        } else [[self connection] sendRawMessageImmediatelyWithFormat:@"PART %@", [self name]]; 
     46 
    4147        [self _setDateParted:[NSDate date]]; 
    4248}