Address a few font issues that have cropped up recently. Fixes #12906.
In previous releases of Adium, we would drop (in a few situations) the font tag information for outgoing messages if it was Helvetica sized 12. This, of course, was terribly confusing: if you specified any attributes, such as color, weight, decoration, etc., it forced Helvetica again.
In Snow Leopard, Apple started including the background color by default in our attributed strings, which has been causing us to, once again, force font tags in situations where we wouldn't before. Sometimes you'd see Helvetica, sometimes you wouldn't. Confusing.
Instead of trying to send plaintext, which we failed at in a good amount of situations (and all situations in SL), we now always send the font information. This was done by removing the forced Helvetica/12 assumptions in the HTML decoder.
We also respect the "show message fonts" preference for outgoing messages on top of incoming. This was another part of the confusing affects that a non-forced default of Helvetica was causing. Outgoing would appear Helvetica, incoming would be the non-allowed default WKMV font.
I tried to approach this as "strip the background color when foreground isn't specified, go back to the way the old things were" but its behavior was just honestly confusing. Let's be consistent in some way.
1.1 --- a/Frameworks/Adium Framework/Source/AIHTMLDecoder.m Tue Oct 27 22:45:52 2009 -0700
1.2 +++ b/Frameworks/Adium Framework/Source/AIHTMLDecoder.m Wed Oct 28 01:57:39 2009 -0400
1.3 @@ -249,10 +249,10 @@
1.4 }
1.5
1.6 //Setup the default attributes
1.7 - NSString *currentFamily = [@"Helvetica" retain];
1.8 + NSString *currentFamily = nil;
1.9 NSString *currentColor = nil;
1.10 NSString *currentBackColor = nil;
1.11 - int currentSize = 12;
1.12 + int currentSize = 0;
1.13 BOOL currentItalic = NO;
1.14 BOOL currentBold = NO;
1.15 BOOL currentUnderline = NO;
2.1 --- a/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m Tue Oct 27 22:45:52 2009 -0700
2.2 +++ b/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m Wed Oct 28 01:57:39 2009 -0400
2.3 @@ -703,12 +703,8 @@
2.4 */
2.5 NSString *htmlEncodedMessage = [AIHTMLDecoder encodeHTML:[content message]
2.6 headers:NO
2.7 - fontTags:([content isOutgoing] ?
2.8 - YES :
2.9 - showIncomingFonts)
2.10 - includingColorTags:(allowsColors ?
2.11 - ([content isOutgoing] ? YES : showIncomingColors) :
2.12 - NO)
2.13 + fontTags:showIncomingFonts
2.14 + includingColorTags:showIncomingColors
2.15 closeFontTags:YES
2.16 styleTags:YES
2.17 closeStyleTagsOnFontChange:YES