Changeset 2013

Show
Ignore:
Timestamp:
10/10/04 22:29:06 (4 years ago)
Author:
timothy
Message:

Allows scripts to do the following during "on process incoming chat message":
set body of theMessage to "New Message."

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/JVChatMessage.m

    r1882 r2013  
    257257        if( ! _attributedMessage ) { 
    258258                if( [message isKindOfClass:[NSTextStorage class]] ) _attributedMessage = [message retain]; 
    259                 else _attributedMessage = [[NSTextStorage alloc] initWithAttributedString:message]; 
    260         } else [_attributedMessage setAttributedString:message]; 
     259                else if( [message isKindOfClass:[NSAttributedString class]] ) _attributedMessage = [[NSTextStorage alloc] initWithAttributedString:message]; 
     260                else if( [message isKindOfClass:[NSString class]] ) _attributedMessage = [[NSAttributedString alloc] initWithString:(NSString *)message]; 
     261        } else if( _attributedMessage && [message isKindOfClass:[NSAttributedString class]] ) { 
     262                [_attributedMessage setAttributedString:message]; 
     263        } else if( _attributedMessage && [message isKindOfClass:[NSString class]] ) { 
     264                id string = [[[NSAttributedString alloc] initWithString:(NSString *)message] autorelease]; 
     265                [_attributedMessage setAttributedString:string]; 
     266        } 
    261267} 
    262268