Ticket #1386: mutable_message_attributes.patch

File mutable_message_attributes.patch, 3.7 KB (added by hennk, 3 years ago)
  • Chat

    diff --git a/Chat Core/MVIRCChatConnection.m b/Chat Core/MVIRCChatConnection.m
    index 1e689b9..d12fa2d 100755
    a b  
    985985    if( echo ) { 
    986986        MVChatRoom *room = ([target isKindOfClass:[MVChatRoom class]] ? target : nil); 
    987987        NSNumber *action = ([[attributes objectForKey:@"action"] boolValue] ? [attributes objectForKey:@"action"] : [NSNumber numberWithBool:NO]); 
    988         NSDictionary *privmsgInfo = [NSDictionary dictionaryWithObjectsAndKeys:msg, @"message", [self localUser], @"user", [NSString locallyUniqueString], @"identifier", action, @"action", target, @"target", room, @"room", nil]; 
     988        NSMutableDictionary *privmsgInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:msg, @"message", [self localUser], @"user", [NSString locallyUniqueString], @"identifier", action, @"action", target, @"target", room, @"room", nil]; 
    989989        [self performSelector:@selector( _handlePrivmsg: ) withObject:privmsgInfo]; 
    990990    } 
    991991 
     
    18951895#pragma mark - 
    18961896#pragma mark Incoming Message Replies 
    18971897 
    1898 - (void) _handlePrivmsg:(NSDictionary *) privmsgInfo { 
     1898- (void) _handlePrivmsg:(NSMutableDictionary *) privmsgInfo { 
    18991899    MVAssertMainThreadRequired(); 
    19001900 
    19011901    MVChatRoom *room = [privmsgInfo objectForKey:@"room"]; 
     
    19651965        if( ctcp ) { 
    19661966            [self _handleCTCP:msgData asRequest:YES fromSender:sender forRoom:room]; 
    19671967        } else { 
    1968             NSDictionary *privmsgInfo = [[NSDictionary allocWithZone:nil] initWithObjectsAndKeys:msgData, @"message", sender, @"user", [NSString locallyUniqueString], @"identifier", target, @"target", room, @"room", nil]; 
     1968            NSMutableDictionary *privmsgInfo = [[NSMutableDictionary allocWithZone:nil] initWithObjectsAndKeys:msgData, @"message", sender, @"user", [NSString locallyUniqueString], @"identifier", target, @"target", room, @"room", nil]; 
    19691969            [self performSelectorOnMainThread:@selector( _handlePrivmsg: ) withObject:privmsgInfo waitUntilDone:NO]; 
    19701970            [privmsgInfo release]; 
    19711971        } 
    19721972    } 
    19731973} 
    19741974 
    1975 - (void) _handleNotice:(NSDictionary *) noticeInfo { 
     1975- (void) _handleNotice:(NSMutableDictionary *) noticeInfo { 
    19761976    MVAssertMainThreadRequired(); 
    19771977 
    19781978    id target = [noticeInfo objectForKey:@"target"]; 
     
    20672067        if ( ctcp ) { 
    20682068            [self _handleCTCP:msgData asRequest:NO fromSender:sender forRoom:room]; 
    20692069        } else { 
    2070             NSDictionary *noticeInfo = [[NSDictionary allocWithZone:nil] initWithObjectsAndKeys:msgData, @"message", sender, @"user", [NSString locallyUniqueString], @"identifier", [NSNumber numberWithBool:YES], @"notice", target, @"target", room, @"room", nil]; 
     2070            NSMutableDictionary *noticeInfo = [[NSMutableDictionary allocWithZone:nil] initWithObjectsAndKeys:msgData, @"message", sender, @"user", [NSString locallyUniqueString], @"identifier", [NSNumber numberWithBool:YES], @"notice", target, @"target", room, @"room", nil]; 
    20712071            [self performSelectorOnMainThread:@selector( _handleNotice: ) withObject:noticeInfo waitUntilDone:NO]; 
    20722072            [noticeInfo release]; 
    20732073        } 
     
    20972097 
    20982098    if( [command isCaseInsensitiveEqualToString:@"ACTION"] && arguments ) { 
    20992099        // special case ACTION and send it out like a message with the action flag 
    2100         NSDictionary *msgInfo = [NSDictionary dictionaryWithObjectsAndKeys:arguments, @"message", sender, @"user", [NSString locallyUniqueString], @"identifier", [NSNumber numberWithBool:YES], @"action", room, @"room", nil]; 
     2100        NSMutableDictionary *msgInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:arguments, @"message", sender, @"user", [NSString locallyUniqueString], @"identifier", [NSNumber numberWithBool:YES], @"action", room, @"room", nil]; 
    21012101 
    21022102        [self _handlePrivmsg:msgInfo]; // No need to explicitly call this on main thread, as we are already in it. 
    21032103