Changeset 2132

Show
Ignore:
Timestamp:
11/21/04 10:50:28 (4 years ago)
Author:
timothy
Message:

Same as r2129 and r2130. Seems to prevent the need to do a reload style twice when first joining a room.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/overhaul/JVChatTranscript.m

    r2112 r2132  
    152152        [display setUIDelegate:self]; 
    153153        [display setPolicyDelegate:self]; 
     154        [display setFrameLoadDelegate:self]; 
    154155 
    155156        if( [self isMemberOfClass:[JVChatTranscript class]] ) { 
     157                if( ! _chatEmoticons && xmlHasProp( xmlDocGetRootElement( _xmlLog ), "emoticon" ) ) { 
     158                        xmlChar *emoticonProp = xmlGetProp( xmlDocGetRootElement( _xmlLog ), "emoticon" ); 
     159                        [self setChatEmoticons:[NSBundle bundleWithIdentifier:[NSString stringWithUTF8String:emoticonProp]] performRefresh:NO]; 
     160                        xmlFree( emoticonProp ); 
     161                } 
     162 
    156163                if( ! _chatStyle && xmlHasProp( xmlDocGetRootElement( _xmlLog ), "style" ) ) { 
    157164                        xmlChar *styleProp = xmlGetProp( xmlDocGetRootElement( _xmlLog ), "style" ); 
     
    160167                        xmlFree( styleProp ); 
    161168                } 
    162  
    163                 if( ! _chatEmoticons && xmlHasProp( xmlDocGetRootElement( _xmlLog ), "emoticon" ) ) { 
    164                         xmlChar *emoticonProp = xmlGetProp( xmlDocGetRootElement( _xmlLog ), "emoticon" ); 
    165                         [self setChatEmoticons:[NSBundle bundleWithIdentifier:[NSString stringWithUTF8String:emoticonProp]]]; 
    166                         xmlFree( emoticonProp ); 
    167                 } 
    168169        } 
    169170 
     
    185186        [self _updateChatStylesMenu]; 
    186187        [self _updateChatEmoticonsMenu]; 
    187  
    188         [self performSelector:@selector( _reloadCurrentStyle: ) withObject:nil afterDelay:0.]; 
    189188} 
    190189 
     
    428427        [[display window] disableFlushWindow]; 
    429428 
    430         [display setFrameLoadDelegate:self]; 
    431429        [[display mainFrame] loadHTMLString:[self _fullDisplayHTMLWithBody:@""] baseURL:nil]; 
    432430} 
     
    829827                [[display window] enableFlushWindow]; 
    830828 
    831         [display setFrameLoadDelegate:nil]; 
    832  
    833829        NSScrollView *scrollView = [[[[display mainFrame] frameView] documentView] enclosingScrollView]; 
    834830        [scrollView setHasHorizontalScroller:NO]; 
  • branches/overhaul/JVDirectChat.m

    r2122 r2132  
    259259        NSString *variant = nil; 
    260260        NSBundle *emoticon = nil; 
    261          
     261 
    262262        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refreshIcon: ) name:MVChatConnectionDidConnectNotification object:[self connection]]; 
    263263        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector( _refreshIcon: ) name:MVChatConnectionDidDisconnectNotification object:[self connection]]; 
    264          
     264 
     265        [display setUIDelegate:self]; 
     266        [display setPolicyDelegate:self]; 
     267        [display setFrameLoadDelegate:self]; 
     268 
     269        if( [(NSString *)[self preferenceForKey:@"emoticon"] length] ) { 
     270                emoticon = [NSBundle bundleWithIdentifier:[self preferenceForKey:@"emoticon"]]; 
     271                if( emoticon ) [self setChatEmoticons:emoticon performRefresh:NO]; 
     272        } 
     273 
    265274        if( [self preferenceForKey:@"style"] ) { 
    266275                style = [JVStyle styleWithIdentifier:[self preferenceForKey:@"style"]]; 
    267276                variant = [self preferenceForKey:@"style variant"]; 
    268277                if( style ) [self setChatStyle:style withVariant:variant]; 
    269         } 
    270  
    271         if( [(NSString *)[self preferenceForKey:@"emoticon"] length] ) { 
    272                 emoticon = [NSBundle bundleWithIdentifier:[self preferenceForKey:@"emoticon"]]; 
    273                 if( emoticon ) [self setChatEmoticons:emoticon]; 
    274278        } 
    275279