Adium

Changeset 14624

Show
Ignore:
Timestamp:
12/26/2005 10:52:03 AM (3 years ago)
Author:
evands
Message:

Added %destinationDisplayName% for header/footer and %senderDisplayName% for messages to the webkit style substitutions. These substitute to the serverside display name (e.g. MSN display name) if possible and otherwise fall back on the normal display name.

Fixes #239

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m

    r14513 r14624  
    702702                } while (range.location != NSNotFound); 
    703703         
     704                do { 
     705                        range = [inString rangeOfString:@"%senderDisplayName%"]; 
     706                        if (range.location != NSNotFound) { 
     707                                NSString *serversideDisplayName = ([contentSource isKindOfClass:[AIListContact class]] ? 
     708                                                                                                   [(AIListContact *)contentSource serversideDisplayName] : 
     709                                                                                                   nil)]; 
     710                                if (!serversideDisplayName) { 
     711                                        serversideDisplayName = [contentSource displayName]; 
     712                                } 
     713                                 
     714                                [inString replaceCharactersInRange:range 
     715                                                                                withString:[serversideDisplayName stringByEscapingForHTML]]; 
     716                        } 
     717                } while (range.location != NSNotFound); 
     718                 
    704719                do{ 
    705720                        range = [inString rangeOfString:@"%service%"]; 
     
    904919                } 
    905920        } while(range.location != NSNotFound);   
    906  
     921         
     922        do { 
     923                range = [inString rangeOfString:@"%destinationDisplayName%"]; 
     924                if (range.location != NSNotFound) { 
     925                        NSString *serversideDisplayName = [[chat listObject] serversideDisplayName]; 
     926                        if (!serversideDisplayName) { 
     927                                serversideDisplayName = [chat displayName]; 
     928                        } 
     929                         
     930                        [inString replaceCharactersInRange:range 
     931                                                                        withString:[serversideDisplayName stringByEscapingForHTML]]; 
     932                } 
     933        } while (range.location != NSNotFound); 
     934                 
    907935        do{ 
    908936                range = [inString rangeOfString:@"%incomingIconPath%"];