Ticket #1046: ticket1046fix.patch

File ticket1046fix.patch, 2.5 KB (added by Esteth, 19 months ago)

Patch

  • Panels/JVDirectChatPanel.h

     
    6666- (void) echoSentMessageToDisplay:(JVMutableChatMessage *) message; 
    6767- (JVMutableChatMessage *) currentMessage; 
    6868 
     69- (void) addMessageToHistory:(id)message; 
     70 
    6971- (void) performNotification:(NSString *) identifier withContextInfo:(NSDictionary *) context; 
    7072 
    7173- (NSUInteger) newMessagesWaiting; 
  • Panels/JVDirectChatPanel.m

     
    998998} 
    999999 
    10001000#pragma mark - 
     1001#pragma mark History manipulation 
     1002 
     1003- (void) addMessageToHistory:(id) message { 
     1004    if( ! [message length] ) return; 
     1005    if( [_sendHistory count] ) 
     1006        [_sendHistory replaceObjectAtIndex:0 withObject:[[[NSAttributedString alloc] initWithString:@""] autorelease]]; 
     1007    [_sendHistory insertObject:[[message copy] autorelease] atIndex:1]; 
     1008    if( [_sendHistory count] > [[[NSUserDefaults standardUserDefaults] objectForKey:@"JVChatMaximumHistory"] unsignedIntValue] ) 
     1009        [_sendHistory removeObjectAtIndex:[_sendHistory count] - 1];     
     1010} 
     1011 
     1012#pragma mark - 
    10011013#pragma mark Notifications Handling 
    10021014 
    10031015/** 
     
    10661078 
    10671079    _historyIndex = 0; 
    10681080    if( ! [[send string] length] ) return; 
    1069     if( [_sendHistory count] ) 
    1070         [_sendHistory replaceObjectAtIndex:0 withObject:[[[NSAttributedString alloc] initWithString:@""] autorelease]]; 
    1071     [_sendHistory insertObject:[[[send textStorage] copy] autorelease] atIndex:1]; 
    1072     if( [_sendHistory count] > [[[NSUserDefaults standardUserDefaults] objectForKey:@"JVChatMaximumHistory"] unsignedIntValue] ) 
    1073         [_sendHistory removeObjectAtIndex:[_sendHistory count] - 1]; 
     1081    [self addMessageToHistory:[send textStorage]]; 
    10741082 
    10751083    if( [sender isKindOfClass:[NSNumber class]] && [sender boolValue] ) action = YES; 
    10761084 
  • Plug-Ins/Standard

     
    608608    if( chatView && [msg length] ) { 
    609609        JVMutableChatMessage *cmessage = [JVMutableChatMessage messageWithText:msg sender:[connection localUser]]; 
    610610        [chatView sendMessage:cmessage]; 
     611        [chatView addMessageToHistory:msg]; 
    611612        [chatView echoSentMessageToDisplay:cmessage]; 
    612613        return YES; 
    613614    } else if( ( user || room ) && [msg length] ) {