Add a "Default font remover" plugin. Refs #12906 (though really fixes it).
This restores our pre-Snow Leopard behavior of sending plaintext when our defualt default font is specified. This also removes the white background Snow Leopard gives us for the attributed string, which would cause it to be sent for every message as well.
The only 'gotcha' here is that, for example, Helvetica-Oblique (italics) is a different actual font than Helvetica. At this point I'm more or less okay with this behavior.
2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
10 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 * Public License for more details.
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 * @class AICoreComponentLoader
19 * @brief Core - Component Loader
21 * Loads integrated plugins. Component classes to load are determined by CoreComponents.plist
24 #import "AICoreComponentLoader.h"
26 //#define COMPONENT_LOAD_TIMING
27 #ifdef COMPONENT_LOAD_TIMING
28 NSTimeInterval aggregateComponentLoadingTime = 0.0;
31 @interface AICoreComponentLoader ()
32 - (void)loadComponents;
35 @implementation AICoreComponentLoader
42 if ((self = [super init])) {
43 components = [[NSMutableDictionary alloc] init];
45 [self loadComponents];
63 * @brief Load integrated components
65 - (void)loadComponents
67 //Fetch the list of components to load
68 NSArray *componentClassNames = [NSArray arrayWithObjects:
69 @"AIAccountListPreferencesPlugin",
70 @"AIAccountMenuAccessPlugin",
71 @"AIAliasSupportPlugin",
72 @"AIAppearancePreferencesPlugin",
73 @"AIAutoLinkingPlugin",
75 @"AIChatConsolidationPlugin",
76 @"AIChatCyclingPlugin",
77 @"AIContactAwayPlugin",
78 @"AIContactIdlePlugin",
79 @"AIContactInfoWindowPlugin",
80 @"AIContactListEditorPlugin",
81 @"AIContactOnlineSincePlugin",
82 @"AIContactSortSelectionPlugin",
83 @"AIContactStatusColoringPlugin",
84 @"AIContactStatusDockOverlaysPlugin",
85 @"AIContactStatusEventsPlugin",
86 @"AIDockAccountStatusPlugin",
87 @"AIDockBehaviorPlugin",
88 @"AIDockUnviewedContentPlugin",
89 @"AIDualWindowInterfacePlugin",
90 @"AIEventSoundsPlugin",
91 @"AIExtendedStatusPlugin",
93 @"AIMessageAliasPlugin",
94 @"AINewMessagePanelPlugin",
95 @"AINudgeBuzzHandlerPlugin",
96 @"AIContactVisibilityControlPlugin",
98 @"AIStandardToolbarItemsPlugin",
100 @"AIStatusChangedMessagesPlugin",
101 @"AITabStatusIconsPlugin",
102 @"BGContactNotesPlugin",
103 @"BGEmoticonMenuPlugin",
104 @"CBActionSupportPlugin",
105 @"CBContactCountingDisplayPlugin",
106 @"CBContactLastSeenPlugin",
107 @"CBStatusMenuItemPlugin",
108 @"DCInviteToChatPlugin",
109 @"DCJoinChatPanelPlugin",
110 @"DCMessageContextDisplayPlugin",
111 @"AIAddBookmarkPlugin",
113 @"ESAccountNetworkConnectivityPlugin",
114 @"ESAnnouncerPlugin",
115 @"ESApplescriptContactAlertPlugin",
117 @"ESContactClientPlugin",
118 @"ESContactServersideDisplayName",
119 @"ESFileTransferMessagesPlugin",
120 @"AIListObjectContentsPlugin",
121 @"ESOpenMessageWindowContactAlertPlugin",
122 @"ESSafariLinkToolbarItemPlugin",
123 @"ESSendMessageContactAlertPlugin",
124 @"ESUserIconHandlingPlugin",
125 @"ErrorMessageHandlerPlugin",
126 @"GBApplescriptFiltersPlugin",
127 @"SAContactOnlineForPlugin",
128 @"SHLinkManagementPlugin",
129 @"ESGlobalEventsPreferencesPlugin",
130 @"ESGeneralPreferencesPlugin",
132 @"ESSecureMessagingPlugin",
133 @"ESStatusPreferencesPlugin",
134 @"AIAutomaticStatus",
135 @"ESAwayStatusWindowPlugin",
136 @"RAFBlockEditorPlugin",
137 @"SMContactListShowBehaviorPlugin",
140 @"ESPersonalPreferencesPlugin",
142 @"OWSpellingPerContactPlugin",
143 @"GBQuestionHandlerPlugin",
144 @"AINulRemovalPlugin",
145 @"AIDefaultFontRemovalPlugin",
146 @"AIAdvancedPreferencesPlugin",
148 @"AIMentionEventPlugin",
149 @"AITwitterIMPlugin",
152 @"AITwitterURLHandler",
153 @"AITwitterActionsHTMLFilter",
154 @"AIURLShortenerPlugin",
155 @"AIGroupChatStatusTooltipPlugin",
156 @"AIRealNameTooltip",
157 @"AIUserHostTooltip",
158 @"AIIRCChannelLinker",
159 @"AIURLHandlerPlugin",
160 @"AIJumpControlPlugin",
161 @"AIWebKitMessageViewPlugin",
163 @"CBPurpleServicePlugin",
164 @"AIImageUploaderPlugin",
165 @"AITwitterStatusFollowup",
168 //Load each component
169 for (NSString *className in componentClassNames) {
171 #ifdef COMPONENT_LOAD_TIMING
172 NSDate *start = [NSDate date];
174 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
177 if (className && (class = NSClassFromString(className))) {
178 id <AIPlugin> object = [[class alloc] init];
180 NSAssert1(object, @"Failed to load %@", className);
182 [object installPlugin];
184 [components setObject:object forKey:className];
187 NSAssert1(NO, @"Failed to load %@", className);
190 #ifdef COMPONENT_LOAD_TIMING
191 NSTimeInterval t = -[start timeIntervalSinceNow];
192 aggregateComponentLoadingTime += t;
193 AILog(@"Loaded component: %@ in %f seconds", className, t);
196 #ifdef COMPONENT_LOAD_TIMING
197 AILog(@"Total time spent loading components: %f", aggregateComponentLoadingTime);
201 - (void)controllerDidLoad
206 * @brief Close integreated components
208 - (void)controllerWillClose
210 for (id <AIPlugin> plugin in [components objectEnumerator]) {
211 [[NSNotificationCenter defaultCenter] removeObserver:plugin];
212 [plugin uninstallPlugin];
219 * @brief Retrieve a component plugin by its class name
221 - (id <AIPlugin>)pluginWithClassName:(NSString *)className {
222 return [components objectForKey:className];